Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search and Update

Status
Not open for further replies.

abrum

Programmer
May 28, 2002
13
US
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
 
What kind of data type is RejectID? God Bless,
Mike

Yes, I believe in Jesus. ;-)
"Neither is there salvation in any other: for there is none other name under heaven given among men, whereby we must be saved." (Acts 4:12, KJV)
 
RejectID is a Long Int. and is AutoNumbered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top