M
Mike Williams
I have a vba query string that errors when I include a field with a name
that includes a hyphen, like so:
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM `" & sourcepage & "$` WHERE " _
& "(`Student` IS NOT NULL)" _
& "AND (`Student` <> 0) " _
& "AND (`T-Raw` > 1) " _
& "AND (`email` IS NOT NULL)"
If I include the line with the field T-Raw, it errors, even though that is
indeed a valid field. If I delete that line, it runs fine.
How can I construct this string without changing the datasource field name?
THANKS.
that includes a hyphen, like so:
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM `" & sourcepage & "$` WHERE " _
& "(`Student` IS NOT NULL)" _
& "AND (`Student` <> 0) " _
& "AND (`T-Raw` > 1) " _
& "AND (`email` IS NOT NULL)"
If I include the line with the field T-Raw, it errors, even though that is
indeed a valid field. If I delete that line, it runs fine.
How can I construct this string without changing the datasource field name?
THANKS.