M M Mar 16, 2004 #1 I have a query that returns the oldest record in a table. How do I have this one record displayed in a MsgBox? Thanks M
I have a query that returns the oldest record in a table. How do I have this one record displayed in a MsgBox? Thanks M
G Graham R Seach Mar 17, 2004 #2 You'll need to do it in code: Dim db As Database Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.OpenRecordset(qryMyQuery) If rs.AbsolutePosition > -1 Then MsgBox rs!somefield Else MsgBox "No records found." End If rs.Close Set rs = Nothing Set db = Nothing Regards, Graham R Seach Microsoft Access MVP Sydney, Australia
You'll need to do it in code: Dim db As Database Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.OpenRecordset(qryMyQuery) If rs.AbsolutePosition > -1 Then MsgBox rs!somefield Else MsgBox "No records found." End If rs.Close Set rs = Nothing Set db = Nothing Regards, Graham R Seach Microsoft Access MVP Sydney, Australia
M M Mar 17, 2004 #3 That works great. Thanks for your help! M -----Original Message----- You'll need to do it in code: Dim db As Database Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.OpenRecordset(qryMyQuery) If rs.AbsolutePosition > -1 Then MsgBox rs!somefield Else MsgBox "No records found." End If rs.Close Set rs = Nothing Set db = Nothing Regards, Graham R Seach Microsoft Access MVP Sydney, Australia . Click to expand...
That works great. Thanks for your help! M -----Original Message----- You'll need to do it in code: Dim db As Database Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.OpenRecordset(qryMyQuery) If rs.AbsolutePosition > -1 Then MsgBox rs!somefield Else MsgBox "No records found." End If rs.Close Set rs = Nothing Set db = Nothing Regards, Graham R Seach Microsoft Access MVP Sydney, Australia . Click to expand...