Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store value from textbox in two tables.

Status
Not open for further replies.

xollef

Technical User
Apr 23, 2002
30
0
0
Hey.

I would like to be able to store a value feeded in to a textbox in two different tables in the same time? This concerns actually the primary key.

Lets say I have two forms based on different tables and then I fill in the first firm and save it. It saves the information but then when I with a button want's to open the next form, opening with filter so that only the right record should show it can't open the record because it hasn't got a primary key it is only the first table that has got the primary key yet not the second so I can't open the second form.

So how can I then do so that when saving the info on the first form it will save the primary key into the primary key field in both the tables?

Thanks for the help.
 
The first form (the one you're saving) should stay open. Then, in the OnOpen event of the second form, put this:

Me.PrimaryKey = FirstForm.PrimaryKey

That should do it.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top