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
Post a Comment