jerryczarnowski
Registered User.
- Local time
- Yesterday, 20:24
- Joined
- Jan 29, 2012
- Messages
- 31
Hello,
My intent is to prompt the user for a Cutter ID and utilize the InputBox to capture the user's input and pass it to a string variable representing a SQL statement, then run the SQL. When I run the code below, it asks me for a parameter value for CutterID right after the InputBox prompts me. Is the code below correct for my intent?
Private Sub cmdFindCutter_Click()
Dim CutterID As String
Dim Message As String
Dim CutterInfo As String
Message = "Enter Cutter ID"
CutterID = InputBox(Message)
CutterInfo = "SELECT * FROM [Abc_All_Cutters] WHERE [Abc_All_Cutters].[Cutting Tool ID] = CutterID "
DoCmd.OpenForm "UPMF_Cutters", , , , acHidden
Forms![UPMF_Cutters].RecordSource = CutterInfo
DoCmd.Restore
End Sub
My intent is to prompt the user for a Cutter ID and utilize the InputBox to capture the user's input and pass it to a string variable representing a SQL statement, then run the SQL. When I run the code below, it asks me for a parameter value for CutterID right after the InputBox prompts me. Is the code below correct for my intent?
Private Sub cmdFindCutter_Click()
Dim CutterID As String
Dim Message As String
Dim CutterInfo As String
Message = "Enter Cutter ID"
CutterID = InputBox(Message)
CutterInfo = "SELECT * FROM [Abc_All_Cutters] WHERE [Abc_All_Cutters].[Cutting Tool ID] = CutterID "
DoCmd.OpenForm "UPMF_Cutters", , , , acHidden
Forms![UPMF_Cutters].RecordSource = CutterInfo
DoCmd.Restore
End Sub