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.
 
Back
Top