G
Guest
The code below yeilds the 3075 error. The primary key is the 'projectid'. I
have similar code that works for other searches but this keeps giving me the
syntax error. I am blind and can't see the forest through the trees. I
would be very grateful for any help. Thank you in advance.
Private Sub txtFileName_AfterUpdate()
On Error GoTo Err_ACOGIS
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.txtFileName) = True Then
MsgBox "Please Enter A File Name", vbInformation
Exit Sub
End If
stDocName = "frmWorkRequest"
stLinkCriteria = "SELECT DISTINCTROW WORKREQUEST.* FROM WORKREQUEST " & _
"INNER JOIN DEVELOPEDDATADETAILS ON " & _
"WORKREQUEST.PROJECTID = DEVELOPEDDATADETAILS.PROJECTID " & _
"WHERE DEVELOPEDDATADETAILS.PROJECTLOCATION LIKE '*" & Me.txtFileName &
"*';"
If DCount("*", "WORKREQUEST", stLinkCriteria) = 0 Then
MsgBox "No Records Can Be Found" & vbNewLine & "Like File Name " &
Me.txtFileName, vbExclamation
Me.txtFileName = ""
Exit Sub
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.txtFileName = ""
End If
Exit_Err_ACOGIS:
Exit Sub
Err_ACOGIS:
MsgBox "You have encountered error #" & vbNewLine & Err.Number & " " &
Err.Description, vbInformation
Resume Exit_Err_ACOGIS
End Sub
have similar code that works for other searches but this keeps giving me the
syntax error. I am blind and can't see the forest through the trees. I
would be very grateful for any help. Thank you in advance.
Private Sub txtFileName_AfterUpdate()
On Error GoTo Err_ACOGIS
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.txtFileName) = True Then
MsgBox "Please Enter A File Name", vbInformation
Exit Sub
End If
stDocName = "frmWorkRequest"
stLinkCriteria = "SELECT DISTINCTROW WORKREQUEST.* FROM WORKREQUEST " & _
"INNER JOIN DEVELOPEDDATADETAILS ON " & _
"WORKREQUEST.PROJECTID = DEVELOPEDDATADETAILS.PROJECTID " & _
"WHERE DEVELOPEDDATADETAILS.PROJECTLOCATION LIKE '*" & Me.txtFileName &
"*';"
If DCount("*", "WORKREQUEST", stLinkCriteria) = 0 Then
MsgBox "No Records Can Be Found" & vbNewLine & "Like File Name " &
Me.txtFileName, vbExclamation
Me.txtFileName = ""
Exit Sub
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
Me.txtFileName = ""
End If
Exit_Err_ACOGIS:
Exit Sub
Err_ACOGIS:
MsgBox "You have encountered error #" & vbNewLine & Err.Number & " " &
Err.Description, vbInformation
Resume Exit_Err_ACOGIS
End Sub