Hello all, I am having trouble finding a record based on specific criteria and then updating that record. Here's what I have: tblReject with fields ID, and Rework(boolean) among many other fields; qryRework with pulls only the ID and Rework from tblReject. I also have a form, frmRework (bound to qryRework), which is supposed to be able to search on the ID and has a check box to change the status of Rework from true to false or the opposite.
This is what I am working with now:
************************************************************
Private Sub cboFind_AfterUpdate()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strDBName As String
strDBName = "C:\PathName\CurrentDB.mdb"
Set db = OpenDatabase(strDBName)
Set rs = db.OpenRecordset("qryRework", dbOpenDynaset)
rs.FindFirst ("RejectID = " & Trim(Str(cboFind.Value)))
If rs.NoMatch = False Then
Me.Bookmark = rs.Bookmark ' Display the selected record.
Else
MsgBox "Record not found. See Database System Manager", vbInformation & vbOKOnly, "Search Error"
End If
End Sub
************************************************************
I'm not sure what I what I have to do to get the desired solution, this way may not be the best soluton, any help would be appreciated. If I left out any pertinent information, let me know and I can provide more information.
TIA
-Brum
This is what I am working with now:
************************************************************
Private Sub cboFind_AfterUpdate()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strDBName As String
strDBName = "C:\PathName\CurrentDB.mdb"
Set db = OpenDatabase(strDBName)
Set rs = db.OpenRecordset("qryRework", dbOpenDynaset)
rs.FindFirst ("RejectID = " & Trim(Str(cboFind.Value)))
If rs.NoMatch = False Then
Me.Bookmark = rs.Bookmark ' Display the selected record.
Else
MsgBox "Record not found. See Database System Manager", vbInformation & vbOKOnly, "Search Error"
End If
End Sub
************************************************************
I'm not sure what I what I have to do to get the desired solution, this way may not be the best soluton, any help would be appreciated. If I left out any pertinent information, let me know and I can provide more information.
TIA
-Brum