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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top