Opening new form and working with fields on new form

  • Thread starter Thread starter David
  • Start date Start date
D

David

I am using VBAccess to open a new form with the docmd.openform command. The
form opens properly, but I would like to be able to setfocus to a field on
the new form and enter some data into it. I would like to try and keep all
the code on the original form because the form that is being opened is used
for multiple functions. Anyone know what code I could use?

Thanks!

Dave
 
I am using VBAccess to open a new form with the docmd.openform command. The
form opens properly, but I would like to be able to setfocus to a field on
the new form and enter some data into it. I would like to try and keep all
the code on the original form because the form that is being opened is used
for multiple functions. Anyone know what code I could use?

Thanks!

Dave

Should be pretty simple:

DoCmd.OpenForm "formname", <optional parameters>
Forms!formname!txtThis = "Some Value"

The only problem would be if you are opening the form in Dialog mode,
in which case the code will stop at the OpenForm line until the form
is closed.

John W. Vinson[MVP]
 
I'll try that thanks John!

John Vinson said:
Should be pretty simple:

DoCmd.OpenForm "formname", <optional parameters>
Forms!formname!txtThis = "Some Value"

The only problem would be if you are opening the form in Dialog mode,
in which case the code will stop at the OpenForm line until the form
is closed.

John W. Vinson[MVP]
 

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