A
Allen Jaffee
Hello,
Hope I'm posting to right NG.
I don't know what I've done wrong (I'm rather new to this).
I have copied code from a working search function of a form
in MS Access(XP), which works as I want it. I had pasted
the code on another button of the form. When I clk on it, I
input the search criteria, then I get an additional dialog
box that says, "Enter Parameter Value", then I put in the
same search value and then the result is fine.
What or why is this additional box appearing? I certainly
can appreciate what users go thru, as I can not figure it
out.
Any help greatly appreciated.
Code below.
Thx, Jeff
------------------------------------------------------------
----
Private Sub Command36_Click()
On Error GoTo cmdSearch_Err
Dim str_Proc As Variant
str_Proc = InputBox("Enter Barcode or Click Cancel",
"Your Attention Please")
'With wild cards
Form_ProjectorData.RecordSource = "Select * from
tblProjectorService where Barcode Like '*" & str_Proc & "*'"
'Without wild cards
'Form_ProjectorData.RecordSource = "Select * from
tblProjectorService where Barcode = '" & str_Proc & "'"
cmdSearch_Exit:
Exit Sub
cmdSearch_Err:
MsgBox Err.Description, , "#" & Err.Number
Resume cmdSearch_Exit
End Sub
Hope I'm posting to right NG.
I don't know what I've done wrong (I'm rather new to this).
I have copied code from a working search function of a form
in MS Access(XP), which works as I want it. I had pasted
the code on another button of the form. When I clk on it, I
input the search criteria, then I get an additional dialog
box that says, "Enter Parameter Value", then I put in the
same search value and then the result is fine.
What or why is this additional box appearing? I certainly
can appreciate what users go thru, as I can not figure it
out.
Any help greatly appreciated.
Code below.
Thx, Jeff
------------------------------------------------------------
----
Private Sub Command36_Click()
On Error GoTo cmdSearch_Err
Dim str_Proc As Variant
str_Proc = InputBox("Enter Barcode or Click Cancel",
"Your Attention Please")
'With wild cards
Form_ProjectorData.RecordSource = "Select * from
tblProjectorService where Barcode Like '*" & str_Proc & "*'"
'Without wild cards
'Form_ProjectorData.RecordSource = "Select * from
tblProjectorService where Barcode = '" & str_Proc & "'"
cmdSearch_Exit:
Exit Sub
cmdSearch_Err:
MsgBox Err.Description, , "#" & Err.Number
Resume cmdSearch_Exit
End Sub