I used the openform code you supplied and I am now longer getting the error messages. I was thinking that I need the parentheses because the were showing up in examples I was seeing online and because when I was typing out the that command the parentheses show up in the little box that shows all the arguments for a command.
But I am still not pulling up any record when I try to search for a wire number. As far as I can tell, my logic is sold on my IF Else statement. I added a message box prompt in the event that the first statement is not true.
Code:
Private Sub searchBtn_Click()
Dim tstVariables As Integer
Dim strSearch
Dim queryComp
strSearch = ([formSearch])
queryComp = StrComp([wireNumber], [strSearch], [vbBinaryCompare])
If [queryComp] = "0" Then
DoCmd.OpenForm "wireCategoryQuery_V3", , , WhereCondition:="wireNumber='" & strSearch & "'"
ElseIf [queryComp] <> "0" Then
tstVariables = MsgBox(wireNumber, vbOKOnly)
'tstVariables = MsgBox(queryComp, vbOKOnly)
'tstVariables = MsgBox(formSearch, vbOKOnly)
'tstVariables = MsgBox(strSearch, vbOKOnly)
End If
End Sub
The only time the first statement is true is when I search for AES09876 because that is the first wire number on that show up on my wireCategoryQuery.
Which leaves me with two problems:
1 I need to find a way to got through my wireCategoryQuery entry by entry.
2 I need to figure out why my wireCategoryQuery isn't showing all the entries in my wireInfo table. I can see all of the entries on my wireInfor table when I create a new black query looking at the wireNumbers in the wireInfo table.