Double-Click a record on a subform and use the ID as default

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

Guest

Hi all - hoping somebody can help?

I want to be able to use the ondoubleclick property on a subform to open a
form in which details can be added for this particular record profile

The link is a one to many on field Site ID, ie from chosen site i need to
enter many rows of information in another table.

I thought of setting the default value for the site ID in the entry form to
that on the subform but it doesnt select that specific record.

How can I do this - could anyone help

Thanks
 
huzzlepuzzle said:
I want to be able to use the ondoubleclick property on a subform to open a
form in which details can be added for this particular record profile

The link is a one to many on field Site ID, ie from chosen site i need to
enter many rows of information in another table.

I thought of setting the default value for the site ID in the entry form to
that on the subform but it doesnt select that specific record.


You can use the OpenForm method's WhereCondition argument to
specify the records in the form.

Create the DoubleClick event procedure, then add code
something like this:

stDoc = "nameofform"
stWhere = "[Site ID field name] = " & Me.[site id text box]
DoCmd.OpenForm stDoc, , , stWhere
 
Worked like a charm - thanks very much!!
--
Kind Regards

Hazel


Marshall Barton said:
huzzlepuzzle said:
I want to be able to use the ondoubleclick property on a subform to open a
form in which details can be added for this particular record profile

The link is a one to many on field Site ID, ie from chosen site i need to
enter many rows of information in another table.

I thought of setting the default value for the site ID in the entry form to
that on the subform but it doesnt select that specific record.


You can use the OpenForm method's WhereCondition argument to
specify the records in the form.

Create the DoubleClick event procedure, then add code
something like this:

stDoc = "nameofform"
stWhere = "[Site ID field name] = " & Me.[site id text box]
DoCmd.OpenForm stDoc, , , stWhere
 
Back
Top