Opening Specific Form

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

Guest

I am attempting to link forms to one another in Access. Using one button, I
want a subsequent form to open based on ID number, and the previous form to
close. RIght now all I can do is open it up non-specifically. Can someone
help? I'm attempting to write the code but I don't kno what I'm doing!
THanks!
 
I am attempting to link forms to one another in Access. Using one button, I
want a subsequent form to open based on ID number, and the previous form to
close. RIght now all I can do is open it up non-specifically. Can someone
help? I'm attempting to write the code but I don't kno what I'm doing!
THanks!

To open one form to a specific record and also close the current form:

DoCmd.OpenForm "FormName", , , "[RecordID] = " & [RecordID]
DoCmd.Close acForm, Me.Name

The above assumes [RecordID] is a Number datatype field.
Change [RecordID] to whatever the actual Unique Prime Key field name
is.
 

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