Private Sub cboHours_AfterUpdate()
Dim sqlStr As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
sqlStr = "SELECT * FROM dbo_LaserMachineMaintLog WHERE [Laser Machine] =
" & _
"'" & Me.cboLaserMachine & "' " & "AND [Hours] = 47731"
Set rs = db.OpenRecordset(sqlStr, dbOpenDynaset, dbSeeChanges)
'---------------------------------------------------------------------------------------------------------------------------------------------
sqlStr = "SELECT * FROM dbo_LaserMachineMaintLog WHERE [Laser Machine] = " &
_
"'" & Me.cboLaserMachine & "' " & "AND [Hours] = " & Me.cboHours
Set rs = db.OpenRecordset(sqlStr, dbOpenDynaset, dbSeeChanges)
What error message are you getting, and what are the values of cboHours
and sqlStr when you get it?
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
sqlStr = "SELECT * FROM dbo_LaserMachineMaintLog WHERE [LaserMachine] = " &
Me.cboLaserMachine & " AND [Hours] = '" & Me.cboHours & "';"
Set rs = db.OpenRecordset(sqlStr, dbOpenDynaset, dbSeeChanges)