access vba - VBA Run-time error 3075 -


i'm trying write sql query in vba it's not working. not sure why, simple select query. below sql query:

strsqlpharmcontact = "select top 1 tbl_contacts.id,  tbl_contacts.idsite, tbl_contacts.role, tbl_contacts.name,  tbl_contacts.email, tbl_contacts.phone, tbl_contacts.involvement,  tbl_contacts.taken" _ & "from tbl_contacts " _ & "where (((tbl_contacts.role)= 'pharmacist') ,  ((tbl_contacts.involvement)=true) , ((tbl_contacts.taken)=false)); " 

cheers guys

most error because of spacing issue in query. need space shown below

& " tbl_contacts " _    ^---- here 

otherwise, query string looks like

select top 1 tbl_contacts.id, tbl_contacts.idsite,  tbl_contacts.role, tbl_contacts.name,  tbl_contacts.email, tbl_contacts.phone,  tbl_contacts.involvement, tbl_contacts.takenfrom tbl_contacts                                              ^-- error here 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -