Open form to new record linked to prior form

dashingirish

Registered User.
Local time
Today, 01:31
Joined
Jan 24, 2012
Messages
13
Hi everyone:

I've got two tables, TblClient and TblAssessment.

I've linked them through clientID.

I've placed an Open Form button on FrmClient. It opens FrmAssessment.

It works correctly in that clicking the button opens FrmAssessment with the correct clientID. However, it opens to the last TblAssessment record for that clientID.

How do I modify the event on the button so that FrmAssessment opens to a new record, linked through clientID?

Thanks!
 
try the below code and play around.

DoCmd.OpenForm "frmAssessment", , , "ClientID =" & Me.ClientID, acFormAdd

Good Luck
 
Shallo9's code is not going to help you if you are wanting to add a new record you will need to use the OpenArgs portion of the OpenForm command to pass information between the calling form and the form being opened.

The OpenArgs can then be tested in the On Load event of the form being called.

The Sample here, has an example of passing information between forms using the OpenArgs.

Have a look at the On Double Click event of Combo2 on FRM_Records and then the On Load event of FRM_Items.
 

Users who are viewing this thread

Back
Top Bottom