View Single Post
 
Old 04-02-2016, 07:50 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The problem is most likely in the SQL statement. looking at it again, I suspect the itype & isubresp string variables need to be quoted. Try changing StrSQL to:
Code:
    StrSQL As String = "SELECT * FROM [CORE$] WHERE [TYPE]=""" & itype & """ AND [SIG_CREW]= """ & isubresp & """" & _
        " ORDER BY [START] ASC, [COMPLEX] ASC, [UNIT] ASC"
PS: VBA-encoded SQL statements are not my forte.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote