Can we take a specific issue and try and get it working?
I have your database: Tables and Reationships Test for Wire Database_Working_Copy.accdb
I ran the Convert all macros to vba and also add error handling.
I have looked at one of the subs and made some comments that may help with vba.
My comments are those beginning '--
Code:
Private Sub searchBtn_Click()
Dim tstVariables As Integer
'--you should explicitly dim variables with datatype, otherwise they are all variants
'--not a major issue, but is considered best practice
Dim strSearch As String
Dim queryComp As Integer
'--Me represents the current form
'--you identify the control on this form--> so Me.formsearch
strSearch = Me.formSearch
'--Access doesn't know which wirenumber you are referring to
'--it appears to use the wirenumber on the current record
queryComp = StrComp([wireNumber], [strSearch], [vbBinaryCompare])
'--strComp returns an Integer so the " is not needed
'--
'--in Access vba strings are enclosed in double quotes eg mystring ="someChars"
'-- dates are enclosed in hash/octothorpes eg myDate =#07/01/22#
'-- numbers have no enclsoing chars eg myNumber =85
'--
If [queryComp] = 0 Then
'--you are testing if querycomp is 0 or Not 0, no need for ElseIf, just use Else
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
Note: If I am on record 1,which is category FIB, wirenumber AES1234, and type AES or aes into the formsearch control, the msgbox shows AES1234.
If I go to record 2 Category DAT wirenumber SDV1234, and type AES or aes into the formsearch control, the msgbox shows SDV1234.
If I go to record 3 Category AUD wirenumber HDV1234, and type AES or aes into the formsearch control, the msgbox shows HDV1234.
So, it seems Access is using the wirenumber of the current record.
My guess is that if you want to find a record in your table, you need a form with only a search box and a button. You enter a search term, click the button and if a record is found matching your search term, you open a new form with the specific record your found via search.
In your database, the form displaying records in your table is already open and Access appears to use the current record info to populate the msgbox. It is not searching for a record based on your strSearch.