Open form to specific record

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

Guest

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