Hi All,
I think I must really be missing something because I'm having the most difficult time getting what should probably be very simple to work.
On a basic level, as an example, I have two tables:
tbl_NameAge: (NameID <primary key>, myName, Age)
tbl_LivesIn: (LocationID <primary key>, City, State, NameID <as foreign key>)
I realize I'm probably already wrong right off the bat, putting the NameID field in the LivesIn table, but please bear with me.
What I want is to create forms based off the tbl_NameAge and tbl_LivesIn tables.
I want to install a button on the tbl_NameAge form whereby on_click I want it to open the tbl_LivesIn form. From there, I want the two forms to marry up (hence why I was thinking to add the NameID field in both tables).
How do I write the vba so that these two forms will talk to each other? When I created it as a macro and I converted to VBA, the line of code it gave me is:
Docmd.OpenForm "tbl_LivesIn", acNormal, "", "[NameID]=" [&ID], , acNormal
However, when I click, I get a syntax error.
What I'd ultimately like to have is a method to relate to other forms, but only to add that information when necessary (for example, I could create a "FavoriteTeam" or "Job" form).
Lastly, I know I can put this into a query and have the information requested, and build the form off that query, but I get no joy from that, either.
Can anyone tell me what I'm doing wrong?RelateFormsTest.accdb