Open form and set field value based on current form

O

okschlaps

I think this should be an easy one. I have a form with an ID field. On
update, I have an event procedure to open a new form and set a variable equal
to the ID value in the current field, but I can't write the code that will
set the ID field in the new form to that value. I've set the focus on the new
form, but I still get a message that Access can't find the field I'm
referring to.
Thanks
 
S

Sandra Daigle

Anytime you have a code related issue it is a good idea to include the
relevant code in your post so that we have a good starting point. It should
be fairly straightforward:

DoCmd.OpenForm "frmMyForm"
forms!frmMyForm.MyId=me.CurrentId

Replace "MyId" with the name of the control on the new form and "CurrentID"
with the name of the control on the current form.
 
O

okschlaps

Thanks Sandra! Much easier than I was making it. And thanks for the tip on
providing my code.
 
Top