Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using user input to go to record 1

Status
Not open for further replies.

gnosis13

Programmer
Jul 13, 2001
263
US
Using Access 2000. I would like to use VBA to query the user for a value, then use that value to find a record and move to that record.

For example...user clicks a button, is prompted for a productID then the current record is moved to that productID.

I know that you can just pop up the "Find" box from the menu. I would rather have some clean VBA code. Got any ideas?
A+, N+, MCP
 
Hi Choctaw

Here is how, this make use of the Inputbox to prompt for user entry.


Private Sub Command94_Click()

Dim inputText As Integer

inputText = InputBox("Enter ProductID", "Entry Required")

Me.RecordsetClone.FindFirst "[ProjectDescID] = " & inputText
Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub


Hope this helps.

rgrds
LSTAN
 
Thanks....you gave me some more to work with. A+, N+, MCP
 
Actually, I ended up just using an InputBox to set up a filter and added a "clear" button. The users like that better.

The filter method should work in 97 but I am not sure about LSTAN's code. A+, N+, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top