jazminecat23
Programmer
Hi all -
I have a form in an adp, based on a view (query). The form loads fine. The view pulls all records from my table where the status = 0, which are those records where the vendor number <1.
On the form, the user will be entering a vendor number. When the user enters the vendor number, it changes the status to 1.
That works, but the form throws me an error when I go to the next record: "The data was added to the database but the data won't be displayed in the form because it doesn't satisfy the criteria in the underlying record source."
So I'm guessing that this is because the query is based on status = 0, and when they update the item, the status = 1.
How do I get around this? I only want to display those record with status of 0, since this db exists primarily to receive vendor number requests? I tried changing the query to show records where the vendor number is less than 1, but I get the same issue. They query behind the form throws me an error if I change the record to conflict with the query.
Here's the code on the form:
Thanks in advance to anyone who can help me. This is an access 2000 .adp.
I have a form in an adp, based on a view (query). The form loads fine. The view pulls all records from my table where the status = 0, which are those records where the vendor number <1.
On the form, the user will be entering a vendor number. When the user enters the vendor number, it changes the status to 1.
That works, but the form throws me an error when I go to the next record: "The data was added to the database but the data won't be displayed in the form because it doesn't satisfy the criteria in the underlying record source."
So I'm guessing that this is because the query is based on status = 0, and when they update the item, the status = 1.
How do I get around this? I only want to display those record with status of 0, since this db exists primarily to receive vendor number requests? I tried changing the query to show records where the vendor number is less than 1, but I get the same issue. They query behind the form throws me an error if I change the record to conflict with the query.
Here's the code on the form:
Code:
Option Compare Database
Private Sub PrintRecord_Click()
On Error GoTo Err_PrintRecord_Click
Dim stDocName As String
stDocName = "VendorRequestReport"
DoCmd.OpenReport stDocName, acViewPreview, , "[ID]=" & Forms![Open Vendor Number Requests].ID
Exit_PrintRecord_Click:
Exit Sub
Err_PrintRecord_Click:
MsgBox Err.Description
Resume Exit_PrintRecord_Click
End Sub
Private Sub VENDOR_NUM_LostFocus()
If Me.VENDOR_NUM > 0 Then
Me.STATUS = "1"
Me.Status2 = "Done"
Else
Me.STATUS = "0"
Me.Status2 = "New"
End If
DoCmd.Save
End Sub
Thanks in advance to anyone who can help me. This is an access 2000 .adp.