sql result in a text box??

  • Thread starter Thread starter JKlein
  • Start date Start date
J

JKlein

I am trying to use this sql to return the number of records in a query and
show it in a text box.
It shows the text not the value! Any help would be appreciated.

Text23.Value = "SELECT Count(tbl_TempCalendarData.MeetingID) AS
CountOfMeetingID FROM tbl_TempCalendarData GROUP BY
tbl_TempCalendarData.meetingdate HAVING
(((tbl_TempCalendarData.meetingdate)=#5/28/2006#))"
 
JKlein said:
I am trying to use this sql to return the number of records in a
query and show it in a text box.
It shows the text not the value! Any help would be appreciated.

Text23.Value = "SELECT Count(tbl_TempCalendarData.MeetingID) AS
CountOfMeetingID FROM tbl_TempCalendarData GROUP BY
tbl_TempCalendarData.meetingdate HAVING
(((tbl_TempCalendarData.meetingdate)=#5/28/2006#))"

VBA doesn't just execute every string on the off-chance that it might be SQL.
You either need a RecordSet or a DCount() function to do what you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top