Open form to specific record

W

Wylie C

I want to open a form to a record specified by the user through an input box.
The control on the form that contains the number is txtProject. Here is the
code I am trying to make work:

strProjNum = Val(Inputbox("Enter project number","Project Number:"
DoCmd.OpenForm"ProjectsForm",,,"txtProject" & "=" & strProjNum

Thanks
 
S

Steve Schapel

Wylie,

Ok, so as far as I can make out, the code would be like this...
Dim strProjNum As Long
strProjNum = Inputbox("Enter project number","Project Number:")
DoCmd.OpenForm "ProjectsForm", , , "[txtProject]=" & strProjNum
 
Top