Opening Specific Form

C

cutescoot24

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!
 
F

fredg

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.
 
Top