I can't seem to get a field name reference correctly for use in a FindFirst method. Here is the logic I am using:
Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
Dim StrSql As String
Dim StrCriteria As String
Dim StrCriteria1 As String
Dim StrCriteria2 As String
StrSql = "tblBioclass"
Set DB = CurrentDb
StrCriteria1 = Reports![rptFishComm]![tblCCNum].Value
Set LogIt = DB.OpenRecordset(StrSql, dbOpenDynaset)
StrCriteria = " Logit![CCNum] = 'StrCriteria1' "
'StrCriteria2 = LogIt![CCNum]
LogIt.FindFirst StrCriteria
LogIt.Edit
LogIt("Bioclass" = bioclass([txtNorate], [txtIBI])
LogIt.Update
LogIt.Close
End Sub
Now Here is the error message I am getting:
Runtime error '3070'
The Microsoft Jet database engine does not recognize 'Logit!ccnum' as a valid field name or expression.
There is a line in this code that has been commented out that I used to prove to myself that this field has a value in it. It is 'StrCriteria2 = .....'
I am stumped not being able to develop a satisfactory string expression for that field. All I want to do is use the FindFirst method to search the tblBioclass table to find the first record that matches the value found in StrCriteria1 in the ccnum field in the tblBioClass field.
I hope that I have given enough information. Thanks for any help you can offer me!!
Ralph
Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
Dim StrSql As String
Dim StrCriteria As String
Dim StrCriteria1 As String
Dim StrCriteria2 As String
StrSql = "tblBioclass"
Set DB = CurrentDb
StrCriteria1 = Reports![rptFishComm]![tblCCNum].Value
Set LogIt = DB.OpenRecordset(StrSql, dbOpenDynaset)
StrCriteria = " Logit![CCNum] = 'StrCriteria1' "
'StrCriteria2 = LogIt![CCNum]
LogIt.FindFirst StrCriteria
LogIt.Edit
LogIt("Bioclass" = bioclass([txtNorate], [txtIBI])
LogIt.Update
LogIt.Close
End Sub
Now Here is the error message I am getting:
Runtime error '3070'
The Microsoft Jet database engine does not recognize 'Logit!ccnum' as a valid field name or expression.
There is a line in this code that has been commented out that I used to prove to myself that this field has a value in it. It is 'StrCriteria2 = .....'
I am stumped not being able to develop a satisfactory string expression for that field. All I want to do is use the FindFirst method to search the tblBioclass table to find the first record that matches the value found in StrCriteria1 in the ccnum field in the tblBioClass field.
I hope that I have given enough information. Thanks for any help you can offer me!!
Ralph