Change a form's current record

K

kraasty

How do i tell to an opened form/subform (in form view) to display a
specific record?
For example , how can I tell a form to display the record with
the PrimaryKey field = 56

Is there a way to do this in the MacroBuilder instead of the VBeditor ?

Andreas
 
A

Arvin Meyer

kraasty said:
How do i tell to an opened form/subform (in form view) to display a
specific record?
For example , how can I tell a form to display the record with
the PrimaryKey field = 56

DoCmd.OpenForm "FormName" ,,, "[PrimaryKey field] =" & 56
Is there a way to do this in the MacroBuilder instead of the VBeditor ?

Use the Where Clause argument without the quotes or a form variable. Like
this:

[PrimaryKey field]=[Forms]![FormName]![txtID]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Top