I hope someone will show me how to make this query work. I do have a table named tblCalendar with a field named pubLngProposalNo. There is a record in it containing proposal number 20250767 and a field named fTxtPrebill containing the value of yes. Below is my code.
Public Function modCal_Mine()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sqlQuery As String
pubLngProposalNo = 20250767
Set db = CurrentDb
sqlQuery = "SELECT * FROM tblCalendar WHERE rs![fLngProposalNo] = " & pubLngProposalNo & " AND rs![fTxtPrebill] = 'yes'"
Set rs = db.OpenRecordset(sqlQuery)
Do While Not rs.EOF
Debug.Print rs!fLngProposalNo
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
End Function
Thank you in advance for your help