OpenArg with subform criteria

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

Guest

i have a question if anyone can answer.

i have a form(Main) and has a sub form(subMain) and it's in a datasheet
format. i like to click on one of the fields record in the datasheet, say
field: Name and record: John, and this click action will open another
form(frmPerson) that should have "John" in the name field and others
specifications for that peson.

i have and click event under field Name of the subform (subMain) and i guess
i have to set some criteria to the docmd.OpenForm "frmPerson",,,,, to
populate what i want in that form, but i am confused on how to do this. CAN
ANYONE HELP? THANKS.
 
You don't need open args..


Assuming we are in the sub-form, and we want to launch a form that is set to
the SAME record, just go:


me.Refresh
docmd.OpenForm "frmMoreDetails",,,"id = " & me!id

You can remove the me.refresh command if you don't allow editing in the
sub-form.

The openform command simply tells ms-access to open a form, and the "where"
clause sets the forms record to the same one we are viewing in the sub-form
(it is assumed that the record has a key field called id).
 

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