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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Losing key on adding 2nd new record 1

Status
Not open for further replies.

mikepf

Programmer
Sep 5, 2007
38
US
Form1 searches table1 for a key. Go to Form2 and store key (not visible). Then read table2 using this key. If NO match, just enter new data and close Form2 to save to table2-this works ok. But if there IS a match, click on NEW Record icon at top of screen and enter new data-but this New Record icon clears ALL form data including the key. BTW: Setting key at Form Close is after the table2 save. Any help out there?
 
Apparently you are storing the looked up key value in a bound control of Form2, so of course it gets cleared when you tell it to start a new record.

Instead of setting the lookup value to a bound control, you could put it in an unbound control. Then in the form's Before_Insert event, copy the value from the unbound control to the bound control.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top