# Access 2007 Command Button to open Form based on Current Record



## melonhead (May 6, 2002)

I am using Access 2007.


I have a form with a subform in it. 

Form Name: FamilyNameForm
Subform Name: PatientNameForm

I would like to create a command button to open up another form called PolicyholderForm.

The PolicyholderForm is linked to the PatientNameForm by a field name PatientNameID>

I would like the PolicyholderForm to show the data about the individual currently displayed in the PatientNameForm. And if there is no record in the PolicyholderForm that matches, I would like to be able to enter data.

I've tried a number of things and can't seem to quite get it. 

Any ideas? Thanks!


----------



## OBP (Mar 8, 2005)

Has Access 2007 got a Command Button Wizard, if so when creating your button do NOT choose the first Default Option, which is show all records.
Select instead the "Specific Record" version.


----------



## melonhead (May 6, 2002)

It does have a command button and I tried that. However, if there is not a record that already matches the PatientNameID, it prompts me to put in a parameter number. I have to have something that if it is null to add new. 

In 2007, the option that is not the default for the command button is "open the form and find specific data to display" 

Thanks


----------



## OBP (Mar 8, 2005)

Can you post a zipped Access 2000 copy of the database?


----------

