Open form and set field value based on current form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
Thanks Sandra! Much easier than I was making it. And thanks for the tip on
providing my code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top