Hello,
I am making a DB to track tooling.
The tools are already identified by an ID such as TH-101 or YZ-223.
Subsequently I set up the table with an autonumbered field called "RecordId" as the PK.
However, users need to be able to lookup the tools by the toolID. This ID is stored in a field called "ToolID" which is a text field.
I am trying to open the tool's detail page to the selected record and I'm not sure where I am going wrong. Any and all assistance is appreciated. I have listed the code below. The idea is that when the user clicks the 'find' button an inputbox will request the Tool ID and then that will be fed to the query which the dlookup can then use to select the appropriate record.
Code:
Private Sub btnFindTool_Click()
Dim RecordID As String
Dim boxofsox As String
boxofsox = InputBox("Enter ID")
RecordID = DLookup("recordID", "qryToolID_RecordIDConverter", "[ToolID]=" & boxofsox)
End Sub
The referenced query code is:
Code:
SELECT tblDataPrime.recordID, tblDataPrime.toolIDFROM tblDataPrime
WHERE (((tblDataPrime.toolID)=[Enter Tool ID]));