General :: Combo Box Referencing One Table - Inputting Value From Different Table

Jul 11, 2013

I am trying to use a combo box to select the Company in an input record form for my Transactions. In the Transaction table, each record contains the Company ID, but not the company name (I have a relationship with a Company ID primary key in a separate table that has all the companies information).

I would like to be able to select the proper company in the combo box and have the form save the value as the Company ID number with the rest of the input data in a record (it will then refer to the correct company name in the other table if I query it because of the ID key).

View Replies


ADVERTISEMENT

Inputting A Calculated Value Into A Table?

Oct 27, 2013

I have a form where it is necessary for the user to input number of tanker loads, however I would ideally like the table to store the information in m3 which means multiplying whatever the user inputs by 11.3.

My plan was to use an unbound textbox for the user to input the "number of loads" into, then use a query to calculate the value and then a Dlookup to update the value of a control which will be hidden somewhere on the form. I got as far as making the query however then realised that it won't let me add an unbound textbox to a query in order to form an expression. I'd like to stay away from the inbuilt "calculated field" option just in case i need to downgrade to an earlier version than 2013 at some point.

View 1 Replies View Related

Modules & VBA :: Add Records To A Table Referencing A Table In Another Database - DAO

Jan 16, 2015

I am using Access 2010 and I currently use a command button on a form to add new records to a table using data that the user has entered into the form using the code below:

Although this is pretty self-explanatory, here is a key for reference:

Me.lstFacilities = ListBox
Me.cboMeasure = ComboBox
Me.cboYesNo = ComboBox
Me.txtTarget = TextBox

Code:
Private Sub cmdAddMet_Click()
Dim DB As DAO.Database
Dim RS As DAO.Recordset
Dim strSQL As String
Dim i As Integer
Set DB = CurrentDb

[Code] .....

This works great but I would like to be able to pull in data from another database based off of Me.lstFacilities.Column(1, i) which is the FACILITY_ID field and is located in the other database's table. I thought about adding in another string variable(strSQL1) and opening up a separate recordset and database:

Code:
Set DB1 = OpenDatabase("serverotherdb.accdb")
strSQL1 = "SELECT [FieldName] FROM [tblOtherDatabase] IN 'serverotherdb.accdb'"
Set RS1 = DB1.OpenRecordset(strSQL1)

However, I'm not sure where to start pulling in the data from the [fieldname] in the [tblOtherDatabase] when I start the loop below:

Code:
For i = 0 To lstFacilities.ListCount - 1
If lstFacilities.Selected(i) = True Then
RS.AddNew
RS!RELATIONSHIP_ID = Me.lstFacilities.Column(0, i)
RS!MEASUREMENT_PERIOD = Me.cboMeasure

[Code] .....

Is it even possible to do this?

View 10 Replies View Related

Multiple Forms Inputting To One Table

Aug 24, 2004

I'm making a large database. There are over 100 questions per "chapter" of the data I need to enter. The forms aren't large enough to accept everything at once so I broke up the chapters into a few smaller forms. The problem I'm having now is it saying "you can't go to the specified record" whenever I enter the same company name in two of the forms for the same chapter. The company name is the primary key. How can I make it so the techs can go from page to page without breaking up my tables?
Thanks in advance.
Sean Sturts (USMC)

View 3 Replies View Related

Forms :: Inputting Data Into A Form And Getting Multiple Table Entries

Jul 3, 2014

I'm fairly new to access and have been tasked with fixing a database that to my knowledge is built incorrectly but due to budget constraints and the time it would take to build a new one, we have to stick with this one. Here's my problem, in the database is a form that we use to create new entries in a table but when I try to create a new entry through the form, it creates multiple entries in the table with the rest of the data split between all the new table entries. Is this something that is caused by us moving over to the most current version of Access? Is there a way to fix this problem given the software we are using? At one point I had recreated this table because we had been having issues with other aspects of the database (security deposits were not being updated when entered through this form).

View 14 Replies View Related

Question On Table Referencing A Table.

Oct 12, 2006

Howdy all,

I am trying to build a db to track all the different projects I do on my web shop www.mutzigcreations.com (http://www.mutzigcreations.com). One thing I need to do is to be able to track the different materials I make things from. This wouldn't be to bad, but sometimes I use several different materials in one project and for the life of me I can't figure out how to do a table system (or form for that matter) that would let me do this.

I build out of woods, acrylics, and other special materials so I have a table for each of the 3 main types. Then I created tables called Material-1, Material-2, etc..that did table lookups to the 3 main type tables. These tables (material-1, etc..) are then related to my main table called Creations. (is this the correct way to go about it? as I can't seem to get it to work at all)

I would eventually like to set up a form that would have a check box next to Material-1, Material-2, etc...that would enable me to select:

A. if more than one material was used
B. What the materials were.

I didn't want to make several copies of the 3 main tables (wood, acyrilcs, special) as that seemed counter productive since the same info is used for each of the different material-1, material-2 selections.

Can anyone help me figure out what do to, or the best way to do it?

Thank you!
Doug

View 7 Replies View Related

Referencing Another Table Via Drop Down

Jan 11, 2007

Hi all,

have used the wizard to take values for a table dropdown field from another table

the table has

surname forename and class all of which reside in another table... ive tried to set up the bound columns so when you select a surname from the drop down the other two fileds also referencing that 6able are automatically filled in with their corresponding values.

so if the ref table had

smith john 1m

by selecting smith in the new tables drop down, the forename and class fields automatically select the corresponding values from the ref table..

im sure this is possible but cant get it to work and cant find anything on the web (although this is probably down to not knoing the right search string)

any ideas?

dubs

View 5 Replies View Related

Self-Referencing Table Question

Jul 6, 2007

Having (with much help from many of the experts here) overcome the hurdles of junction tables, subform to subform movements, and the seemingly easy design issues of a form, I have now created a self-referencing table. I humbly return to ask for advice from those experienced with these relationships...

I have been led to this in order to load in to my DB a certain class of documents, linking them relationally to their parent documents, while performing the data input for both into the same form. What I have done and what the problem is are as follows:

I created a new field in my form (formDoc), "LinkedExhibit". In the relationship window, I reloaded the Document table and reestablished all prior relationos, then added a second (alias) table Documents1, linking the primary key of this alias to the LinkedExhibits field.

I have the Linked Exh field set up as a combobox linked to DocTitle from the Documents table ONLY for the purpose of saving keystrokes if a duplicate should arise.

Unfortunately, when I enter a new document and then continue entering data through the LinkedExhibit field, and save by moving on to another subform related to these, the Documents table shows all of what I typed, except it shows the Linked Exhibit saved as DocTitle, and the DocTitle that I had typed is gone...

I really am flying blind but believe the alias table is not linked right, or I am using that concept to do something it cannot do...

I am attaching the DB, in Access2007, if someone could lend an eye to it...
I would appreciate that.

View 14 Replies View Related

Cross Referencing Records From A Single Table

Sep 22, 2005

I tried the idea sugested in post (http://www.access-programmers.co.uk/forums/showthread.php?p=423080#post423080) but it didn't seem to give the cross referencing that I had hoped for .... example 1 is related to 4,3, and 5 while 6 is related to 1 thus implying an extended relationship to 4,3, and 5.

In a standard one-to-many I'd look at record 1 and see that it is related to 4,3,5 but if I were to look at record 6 I'd only see that it is related to 1. How would I set up the table relationships to drill further to see that 1 is also related to 4,3,5?

How do you do a many-to-many from one table back to that same table?

tblEvent
EventID(AutoNumber) EventTitle(Memo)
1 memo content
2 data
3 more memo content
4 some info
5 more stuff
6 other text

tblEventRelationships
EventParrent EventChild
1 4
1 3
1 5
6 1
3 2

In addition ... how would one set up the integrity to prevent loops from forming?

View 6 Replies View Related

Referencing To Users Collection For A User Table Possible?

Jul 27, 2007

My search was snowballed with lot of results about dealing with split database, seeing who's online, etc. so I'm not sure if that is a good idea.

I want to make a table of Users because my users may need to put their name on some of reports, so I could use CurrentUser() to figure out who's who and put down their proper name after comparing the username via a query.

However, I'm not sure if it's possible for me to link the user table to the user groups of database to ensure that there's no ghosts or users that doesn't have a proper name to be placed on the reports or whatever. More of a validation, really.

Is that doable or maybe there's another way to do that?

Thanks!

View 2 Replies View Related

General :: Populate Combo Box From Table

Nov 9, 2013

So the information that I had to start with was

Colours

Silver
Black

Material

Metal
Plastic
Rubber
Digital

Component

Screen
Keyboard
Mouse Pad
Case
Hinge

So I've created 3 tables - one for each information group arranged like so. However my problems are - I don't know how to make it so that as soon as all the info for one set of parts is filled another set automatically appears? And in the Design section of the Form I have the following error because I wasn't too sure what to use apart from a text box-

View 7 Replies View Related

General :: Combo Box Not Return Description To Table

Feb 20, 2015

My combo boxes are not returning the actual combo box values back to my table, instead in the table it is displaying the combo box data list number i.e 1,2,3,1,5,1 etc where it should be displaying a property address.

View 2 Replies View Related

General :: Delete Table From Combo Box On A Form

Mar 13, 2013

I am trying to delete the data in a table by selecting the table I want to delete the table in from a combo box on a form. This is what I am using :

Dim strFileName As Variant
strFileName = File_imported
DoCmd.DeleteObject acTable = strFileName

View 3 Replies View Related

General :: Adding Two Numbers While Inputting The Information?

Apr 1, 2014

I have a database where on the form we are just put in total deductions. We want to make sure that the total deductions is correct so while we are entering this number we want to do an excel thing by hitting = 1 + 1. Anytime we do that we are getting an error message. I really didn't want to have to set up a table to store these different amounts because we really only need the total. Is there a way to do that? I changed the format from currency to general but I'm still getting the error.

View 2 Replies View Related

General :: Add New Records To A Table Depending On What Combo Box Displays

Jun 4, 2013

I need to add new records to a table depending on what the cbo box displays. I figure this is the way to do it but I it's not working, I have only writen the first select,

Private Sub Comando6_Click()
Dim dbPalavraChave As DAO.Database
Dim rstchaveCFEPC As DAO.Recordset
Set dbPalavraChave = CurrentDb
Set rstchaveCFEPC = dbPalavraChave.OpenRecordset("chaveCFEPC")

[code]...

View 9 Replies View Related

General :: Combo Box To Show Name For User But Input ID To Tag Table

Jul 14, 2013

I have a AUCTION form, it has a combo box and the label for this combo box is called seller. This combo box is a look up to the USER table which has the following fields:

uid, uname, city, state

The combo box is pulling and displaying a drop down list of uname from the USER table, with this SQL state in the "row source".

Code:
SELECT user.uname FROM [user] ORDER BY user.uname;

In the control source of this combo box I have seller, and the form's record source is AUCTION, tagging on the AUCTION table.

The problem is the form is putting the uname into the AUCTION table's seller field, but I want it to input the uid field, however that it should still show the uname list when the user click on the combo box to make a selection.

View 2 Replies View Related

General :: Combo Box - Exclude Data Insert In Table

Oct 19, 2014

I have to combine groups to account, then when account is a group in next time, list or combobox, this group must not to be in that list. what is the solution ? SQL or VB. I append file...

View 6 Replies View Related

General :: Cascading Combo Boxes With Junction Table

Jul 5, 2013

I'm jumping to the forms development and going to try what I need via queries and SQL. I'm trying to do a series of cascading combo boxes which have worked out fine, right till I hit the first junction table.

I will include the VBA code below as well as a screenshot but here's how it goes.

REGION cascades down to COUNTRY cascades down to PORT and then to CARRIER.

This is for a shipping program.

When it gets to PORT and are trying to cascade to the various CARRIER's thats where it hits a junction table of PORT_CARRIER.

Here is REGION to COUNTRY:

Me.cboCountry.RowSource = "SELECT COUNTRY.CNTRY_ID, COUNTRY.COUNTRY FROM COUNTRY " & _ " WHERE REG_ID = " & Nz(Me.cboRegion) & _
" ORDER BY COUNTRY"
Me.cboCountry = Null

COUNTRY to PORT :

Me.cboPort.RowSource = "SELECT PORT.PORT_ID, PORT.PORT FROM PORT " & _
" WHERE CNTRY_ID = " & Nz(Me.cboCountry) & _
" ORDER BY PORT"
Me.cboPort = Null

PORT to CARRIER:

Me.cboCarrier.RowSource = "SELECT PORT_CARR.PORT_ID, PORT_CARR.CARR_ID FROM PORT_CARR " &_ " WHERE PORT_ID = " & Nz(Me.cboPort) & _
" ORDER BY CARR_ID"
Me.cboCarrier = Null

PORT to CARRIER is where the problem is.

It populates the combo box, but with the ID numbers instead of actual CARRIER names.

(the Junction table are two PK fields and are lookups to PORT in PORT table and CARRIER in CARRIER table.)

Is there a magic spell for cascading combo boxes when you hit a junction table?

View 14 Replies View Related

Modules & VBA :: Public Function With Variables Referencing Table Date Fields

May 31, 2014

I have a table with only two fields and one record: BegDate and EndDate (beginning and end date of the reporting period respectively). I also made a function with variables that look up those values for use as a date parameter in a query.

Here is the code:

Option Compare Database
Option Explicit
Public Function getCurrentRepDates() As Date
Dim dtBegDate As Date
dtBegDate = DLookup("BegDate", "tblCurrentRepDates")

[Code] ....

I am getting a syntax error for the line marked red. How can I use "Between" function in VBA code? Access 2010

View 5 Replies View Related

Queries :: Select All Dates Since A Given Date Without Referencing A Table? (Access 2007)

Apr 23, 2014

Is it possible to create a query to select all dates from a given reference date? I don't mean all dates in a table - I mean all dates generally?

(The idea being to fill the first field in the resultant dataset with the list of dates, then run subqueries off that to fill the remaining calculated fields)

I'm currently using a date field in one of my tables to populate this first field (the full SQL is in a separate thread here)

But that was just a convenient way of getting a list of dates; the dates in that table don't actually have any significance to the resulting dataset (other than they should roughly overlap with the dates I'm looking for)

The flaw in that method is that the table from which I get those dates can only ever have dates up to and including yesterday. I also need to get today's date in there (and calculate the subqueries based on that date as well).

It's also possible - although unlikely - that there could be random dates missing from that table as well - in which case I need to plug those gaps and calculate my fields for those missing dates as well.

For clarity; that first field (AsOfDate) should contain every weekday from the earliest date in that table (i.e. Min([tblBalances].[BalanceDate]) up to and including today. It doesn't matter if any of the dates inbetween are missing from tblBalances as the subqueries will just return zeroes for those dates (which is exactly what I want to see).

View 3 Replies View Related

Access 2010 - Main Menu Needs Drop Down Box Referencing A Table For SEARCH

May 6, 2014

I have a main menu "MainMenuF" in my database and I would like the database to be able to be searched by any of the column headings. For example I have a table titled "NewLabReportT" this table has many column headings like "Submitted By" "Reviewed By" "Title" "Abstract" etc...

I would like my users to be able to click a radio button with the same column headers on this main menu and have a box that pops up to say "Enter search parameter" and have that parameter be searched in the table "NewLabReportT" and generate a FORM not a REPORT of all of the listings in the database that have that keyword associated to that certain category searched. That way they can "CLICK" the exact field they are looking for and have it open right up to that form.

View 2 Replies View Related

General :: Auto Populate A Table Field From Combo Selection

Jan 17, 2013

I have a Table (tblFPAData) that is being populated with entries from a form I created. There are several fields but if I can get an answer for one relationship then I can repeat it for the others.

In tblFPAData there are the fields MaterialNo and Description.

I am creating another table called tblSchedule and using a form to enter the information. I need the user to select the MaterialNo from a combo (cmbMaterialNo) and the then table auto populates the Description from tblFPAData.

View 3 Replies View Related

Referencing Data In Combo Box

Feb 3, 2006

Basically MY problem is that i set the control id to that of a primary key so that when the combo box data is changed it puts the data in the table. However my problem is that the data it displays is a price and im trying to calculate a total. Therefore in VBA im trying to find out how to refer to the data displayed in the combo box but isnt the control source.

Thank you in advance
Any help would be much appreciated

View 1 Replies View Related

Forms :: Referencing A Value From Combo Box

May 31, 2014

How to reference a value on a combobox in one form from an object on another form.

I have put in =Forms![Company Name].Combo7 in the field object on the form and I have got the ID autonumber of the Company Name. So far so good. It worked.

When I put in =Forms![Company Name].Combo7.column1 to get the company name to appear in the field I got an error.

What is the correct entry that needs to be entered?

View 4 Replies View Related

Move Record To New Table After Data Change In Combo Box Value In Original Table.

Nov 24, 2006

Ok my problem is this......

I have a form with a field "Property Status" on it. It has 4 possible values -

"C - SHELTERED (with warden charge)";"H - SHELTERED (No warden charge)";"J - WHEELCHAIR SHELTERED (With warden charge)";"M - WHEELCHAIR SHELTERED (No warden charge)";"X - DISCONNECTED"

When the value "X - DISCONNECTED" is selected in the form I want the record to be removed from its existing table and sent to a new table which keeps all the "X - DISCONNECTED" records together.

Any ideas would be greatly appreciated. How would this be coded?

View 1 Replies View Related

Forms :: Update Table That Is Recordsource For Combo Box That Is Updating That Table

Mar 29, 2013

I have a combo box (cboManifestNumber) that is based on the following table:

tblManifestData
ManifestDataIDPK (autonumber PK)
ManifestNumber
RemovedDate
ManifestComments
TsdfIDFK (FK frm tblTSDF)

This table is related to:

tblTSDF
TsdfIDPK (autonumber PK)

I need to be able to update tblManifestData with a new manifest number and manifest comments, along with assigning it a TSDF. how to be able to enter a new manifest number and the associated data without having it create two lines in tblManifestData. I thought that I could enter a new manifest number, then requery the table and form so it shows the complete list of manifest numbers (including the recently entered one) while staying on the newest entry.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved