UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> I Am Having Such A Hard Time With This Simplecsv Function, Access 2013    
 
   
jmkeuning
post Feb 25 2020, 01:18 PM
Post#1



Posts: 262
Joined: 20-October 15



I have this query which gets me the values that I need:

CODE
SELECT tblMeetingAttendees.email
FROM tblMeetingAttendees
WHERE (((tblMeetingAttendees.meetingid)=[forms].[frmstart].[meetingid]));


As a result, I expect this to work when I put it in a textbox on a form (frmstart) with the meetingID parementer:

CODE
=SimpleCSV("SELECT  email FROM tblMeetingAttendees WHERE (meetingid =[meetingid] )",";")


But the SimpleCSV is not filtering the MediaID, it's showing all records in the tblMeetingAttendees table.

So I tried to put that full WHERE syntax in the textbox:

CODE
=SimpleCSV("SELECT  email FROM tblMeetingAttendees WHERE(((tblMeetingAttendees.meetingid)=[forms].[frmstart].[meetingid]))",";")


But that threw an error on the Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot) line in the module.

So I tried this, hard-coding the meetingid into the textbox:
CODE
=SimpleCSV("SELECT  email FROM tblMeetingAttendees WHERE (meetingid =8 )",";")


and that worked, it filtered the emails for meetingid 8

so i tired replacing the 8 with the field on the form:
CODE
=SimpleCSV("SELECT  email FROM tblMeetingAttendees WHERE (meetingid =[forms].[frmstart].[meetingid])",";")


but it is back to the error in the module

So, what am I doing wrong that I cannot get the parameter in the meeting id textbox to pass into the simpleCSV?
Go to the top of the page
 
theDBguy
post Feb 25 2020, 01:26 PM
Post#2


UA Moderator
Posts: 78,124
Joined: 19-June 07
From: SunnySandyEggo


Try "concatenating" the variable in your SQL statement.

CODE
=SimpleCSV("SELECT  email FROM tblMeetingAttendees WHERE meetingid =" & [forms].[frmstart].[meetingid],";")


Sent from phone...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
jmkeuning
post Feb 25 2020, 01:39 PM
Post#3



Posts: 262
Joined: 20-October 15



Wow, I mean... I can see that now. And I thought I tried everything. Thank you so much.
Go to the top of the page
 
theDBguy
post Feb 25 2020, 02:19 PM
Post#4


UA Moderator
Posts: 78,124
Joined: 19-June 07
From: SunnySandyEggo


Hi. You're welcome. Good luck with your project and thank you for trying out SimpleCSV(). Cheers!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    30th May 2020 - 07:45 PM