G
Guest
Hi
Below is the code which I have against a command button on a form and for
some reason even though the data is in the table it checks it comes back as
not found.
Can anyone please help me with what I have done wrong.
Set rs = CurrentDb.OpenRecordset("tbl_IssuesError", 2)
Set rs2 = CurrentDb.OpenRecordset("tbl_Head_Office_Stock", 2)
Set rs3 = CurrentDb.OpenRecordset("tbl_Issues", 2)
rs.MoveFirst
Do
stStore = rs.Fields("StoreNo")
stStore = rs.Fields("StoreNo")
stDenom = rs.Fields("Denom")
stVoucher = rs.Fields("VoucherID")
stDate = rs.Fields("IssueDate")
stWhere = "[Denom]=""" & stDenom & """ And [Voucher]=""" & stVoucher
& """"
If rs.Fields("Investigate") = True And rs.Fields("Fixed") = False Then
rs.Edit
rs.Fields("Fixed") = True
rs.Update
If rs.Fields("MissingHeadOffice") = True Then
'''Check Head Office Stock table'''
rs2.MoveFirst
rs2.FindFirst stWhere
If rs2.NoMatch Then '''''''''''''THIS IS WHERE
IT COMES UP AS NOMATCH HOWEVER IT IS IN THE DATABASE'''''''
Call Update_Issued_Error
Else
Call Update_Issued_Table
End If
ElseIf rs.Fields("AlreadySent") = True Then
'''Check if already issued to another store in Head Office
table'''
rs2.MoveFirst
rs2.FindFirst stWhere
If rs2.NoMatch Then
Call Update_Issued_Error
Else
Call Update_Issued_Table
End If
ElseIf rs.Fields("Duplicate") = True Then
'''Check Issued table for duplication'''
rs3.MoveFirst
rs3.FindFirst stWhere
If rs3.NoMatch Then
Call Update_Issued_Error
Else
Call Update_Issued_Table
End If
End If
End If
rs.MoveNext
Loop Until rs.EOF
Below is the code which I have against a command button on a form and for
some reason even though the data is in the table it checks it comes back as
not found.
Can anyone please help me with what I have done wrong.
Set rs = CurrentDb.OpenRecordset("tbl_IssuesError", 2)
Set rs2 = CurrentDb.OpenRecordset("tbl_Head_Office_Stock", 2)
Set rs3 = CurrentDb.OpenRecordset("tbl_Issues", 2)
rs.MoveFirst
Do
stStore = rs.Fields("StoreNo")
stStore = rs.Fields("StoreNo")
stDenom = rs.Fields("Denom")
stVoucher = rs.Fields("VoucherID")
stDate = rs.Fields("IssueDate")
stWhere = "[Denom]=""" & stDenom & """ And [Voucher]=""" & stVoucher
& """"
If rs.Fields("Investigate") = True And rs.Fields("Fixed") = False Then
rs.Edit
rs.Fields("Fixed") = True
rs.Update
If rs.Fields("MissingHeadOffice") = True Then
'''Check Head Office Stock table'''
rs2.MoveFirst
rs2.FindFirst stWhere
If rs2.NoMatch Then '''''''''''''THIS IS WHERE
IT COMES UP AS NOMATCH HOWEVER IT IS IN THE DATABASE'''''''
Call Update_Issued_Error
Else
Call Update_Issued_Table
End If
ElseIf rs.Fields("AlreadySent") = True Then
'''Check if already issued to another store in Head Office
table'''
rs2.MoveFirst
rs2.FindFirst stWhere
If rs2.NoMatch Then
Call Update_Issued_Error
Else
Call Update_Issued_Table
End If
ElseIf rs.Fields("Duplicate") = True Then
'''Check Issued table for duplication'''
rs3.MoveFirst
rs3.FindFirst stWhere
If rs3.NoMatch Then
Call Update_Issued_Error
Else
Call Update_Issued_Table
End If
End If
End If
rs.MoveNext
Loop Until rs.EOF