Hi guys,
I am totally new to VBA but through googling and trial and error I have cobbled together a form which is designed to choose recipients from a database and then email them. However, I'm missing a few important pieces in the jigsaw and am looking for some help.
I have a form with multiselect listbox which comprises all the values from a table called CardType.
Firstly, how can i get the values selected in vba to put in my query?
listboxname.value doesn't give me anything.
Secondly, how do i create a multi WHERE sql statement? Is it an AND keyword e.g.
SELECT * FROM customers WHERE x = y AND a = b
Finally, when i have run my query, how do i loop through the results and create a string of comma separated list of email addresses?
I have programming experience and could do this in java or php but i'm lost when it comes to vba.
I am totally new to VBA but through googling and trial and error I have cobbled together a form which is designed to choose recipients from a database and then email them. However, I'm missing a few important pieces in the jigsaw and am looking for some help.
I have a form with multiselect listbox which comprises all the values from a table called CardType.
Firstly, how can i get the values selected in vba to put in my query?
listboxname.value doesn't give me anything.
Secondly, how do i create a multi WHERE sql statement? Is it an AND keyword e.g.
SELECT * FROM customers WHERE x = y AND a = b
Finally, when i have run my query, how do i loop through the results and create a string of comma separated list of email addresses?
I have programming experience and could do this in java or php but i'm lost when it comes to vba.