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 Replies
ADVERTISEMENT
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
Jul 8, 2014
I know this is simple, but I feel like Simple Jack this morning. I'm trying to take the text from a drop-down menu and use that as part of the form caption. However, the text is not what is bound, the ID number is.
View 4 Replies
View Related
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
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 3 Replies
View Related
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
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
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
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
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
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
Apr 17, 2007
I have a db that had to be designed taking into consideration a previous db. Merging went well. On several of the forms that feed the tables there are drop down boxes for entry consistency. Those drop down boxes have two columns. Ex is Counties field: Column 1 = County Name Column 2 = Numerical Designation.
On the form the dropdown shows the name for selection.
On the table it is a different story. On the portion of the table that came from the old db the field shows the Name. On the portion of the table that pertains to data entered since the new db, only the number shows. This also means it won't let me search by county name - only by number which doesn't work.
I have tried to compare properties for the old and new database for the forms, the tables, etc. and can't find a discrepancy.
1. How can I get the field in the table to show only the name and not the number?
2. Will that solve my search problem?
Oh, does it make a difference that there isn't any sort of pk or fk in the lookup table?
Thanks.
p.s. I am learning as I am going - so really complicated answers are difficult for me
View 1 Replies
View Related
Jul 31, 2006
Hi,
I have a java app connected to a MS access database. I need to run an sql command like
"drop table if exists"
You know, so it only tries to delete the table if its actually there. Im not sure how to do this with an access db.
Also what is the difference between delete and drop.
thanks v much for any help!
View 1 Replies
View Related
Aug 9, 2006
I know this can be done i MySQL and with SQL Server but is there a way to drop the table but check if it exists first in Access before running a query ?
View 1 Replies
View Related
Jul 24, 2012
Is there anyway that access could create a drop down box within a drop down box? For instance, when a selection is made in a drop down box, it opens another drop down box with choices.And is it possible to link an inserted image from a form to open in MSPaint that when it opens, the image is already there?
View 1 Replies
View Related
Feb 15, 2006
Hi All,
I am wanting to build a table which consists of all the queries and tables in the database.
I am expecting column 1 to have all the queries and column 2 to contain all the tables that make up the query. So the table will look like this:
Queries - Linked Tables
Query1 - Table1
Query2 - Table1
Query2 - Table2
Query3 - Table1
Query3 - Table4
As you can see a table can be linked to any number of tables.
Now for my actual question. I don't want to have to type in all the queries and tables. I would like to choose any query and table from a drop down of all possible queries and tables that are currently in the database - like a list, where the list contains all the possible values.
I would then select the relevant entry.
Any pointers would be great.
Thanks,
Evan
View 2 Replies
View Related
Jan 26, 2008
It is essential that i use MS access to do this, what i need to do is have a drop down list on an ms access table to make sure the data in the field is exact, i could use validation if this is not possible but i would prefer this method also i dont need an answer to this but is there a way to make the key field dependant on whatever is selected on the dropdown menu? sort of use a general input mask but alter something dependant on the drop down menu to have it as specific characters, i have some experience with VB if there is a way to link vb programming with access
View 6 Replies
View Related
Jul 7, 2015
I had 3 drop down filters that worked when the word being filtered was written in the table. I have since then linked them to new tables to be more database-y. The problem I have found (a couple weeks later too) is that my drop downs broke.
It makes sense why, they are now 1,2,3,4 instead of words but how do I make this work now that it isn't in the current table?
Code:
Private Sub cboMDS_AfterUpdate()
Dim myPlane As String
If Me.cboMDS = 0 Then
myPlane = "Select * from Baseline"
[Code] ....
View 10 Replies
View Related
Oct 1, 2013
1) I want to figure out how I can drop a table using "if argument". If the table exists then drop table, if not exists do something else.
2) I want to figure out (ALSO) how I can drop a column using "if argument". If the column exists then drop column, if not exists do something else.
I wrote something but is not enough..I can't find more clear information about that.
Function first()
On Error GoTo Macro1_Err
Dim BD1 As Recordset
DoCmd.SetWarnings False
Set BD1 = CurrentDb.OpenRecordset("BD_example table")
[Code] ....
View 8 Replies
View Related
Feb 27, 2014
I was browsing the Northwind database and notice that there is a dropdown in the table (See attached print screen). I've been trying to recreate it but I'm having a hard time.
View 2 Replies
View Related
Sep 12, 2014
I would like the user to enter information directly into an Access table (it's ok). I want one column to have month ended. In this column, there would be a drop down/lookup menu with each month of the year. The user selects the month we are being billed for.
Then another column called week ending date, would display all week ending dates (ends on a Sunday) but only for the month that was selected.
If the user selected another month on another row, the available weekending dates to select from would show only what pertains to the month selected. Is it possible to do this?
View 2 Replies
View Related
May 12, 2006
Hi,
For some reason I cant see the drop zones when I am pivot table view. Does anyone know maybe why I cant see this?
When I try to use the 'Add To' box in the Field List Box, the option is grey'd out so I cant click it.
I'm using version 2002.
Can anyone help?
Claudia
View 4 Replies
View Related
Nov 6, 2012
I would like to be able to select a value from a drop-down and by doing so be able to populate three fields in a table.
View 12 Replies
View Related
Jul 21, 2005
I have a form with a drop down list, when the user selects an option and press a button. I would like to add the value of the drop down list to a table as a new record.
Thx :mad:
View 2 Replies
View Related
Mar 28, 2013
I have a sizable list of GIS polygon shapes(~9000 data points), collected over 15 years, that I am trying to shrink down to unique ID's. Each years data has a unique label, but for many of the polygons the shape does not change from year to year, so I want to assign a unique ID that encompasses all of the years that shape existed. Some examples:
1950- Parcel A - 2 acre star same
1951- Parcel K - 2 acre star same
1952- Parcel L - 2 acre star same
1953- Parcel F - 2 acre star same
1954- Parcel J - 3 acre box same
1955- Parcel Z - 3 acre box same
Ok, simple enough. I created a unique polygon ID in a separate table, and set the first 4 records to some value, let's say AAAA. The latter 2 records I called something else, BBBB let's say. These values are used in a combobox so my data entry stooges can easily assign each duplicated polygon the same ID, so a quick query will show that polygon XXXX is comprised of so many years worth of the same value, just with a different label. Now my question...
In the above example, after 1953 the 2 acre star polygon never exists again, so I want to 'retire' that option from the combobox so it cannot be chosen in error. As it stands now, if I were to enter the following date point 1956- Parcel N - 3 acre box
I can still choose AAAA or BBBB as the unique polygon ID to equate it to. Is there some way (maybe a boolean option) to disable just a specific combobox value so it cannot be entered in new records, but STILL shows up in old records, a.k.a. is not deleted?
View 6 Replies
View Related
Aug 6, 2014
In my form's table (tblMain), I've got a lookup field (drop-down list) that lists the primary key field from a different table (tblDiff). tblDiff includes 3 more fields. In my form for tblMain, I want to include 3 more textboxes that get filled up with these 3 fields from tblDiff when the corresponding primary key is selected in the drop-down box.
View 9 Replies
View Related