Moira Triance
Registered User.
- Local time
- Today, 01:24
- Joined
- Sep 27, 2001
- Messages
- 16
Hi
I had some very useful help last week from Marion in converting an Access 97 db to 2002. Now my problem has moved on as I am trying to convert the mail merge code in the same db so that when I click on a command button it merges 1 record from a query with a letter. Sounds simple, but I have studied the previous posts on this topic and can't see why my code is wrong.
The error I am getting is "Invalid SQL Statement; expected 'Select', 'Delete', Insert' etc. I have used Debug to narrow this down to one statement, which is:
' Open a recordset based on the qStudentAcceptLetter query.
rstStudent.Open " qStudentAcceptLetter ", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
I modified this code from the Access 2002 VBA step by step book and it works fine in the training example but not in the converted DB.
Any help VERY greatly appreciated. This is driving me crazy!
I have attached the whole sub as a txt file
I had some very useful help last week from Marion in converting an Access 97 db to 2002. Now my problem has moved on as I am trying to convert the mail merge code in the same db so that when I click on a command button it merges 1 record from a query with a letter. Sounds simple, but I have studied the previous posts on this topic and can't see why my code is wrong.
The error I am getting is "Invalid SQL Statement; expected 'Select', 'Delete', Insert' etc. I have used Debug to narrow this down to one statement, which is:
' Open a recordset based on the qStudentAcceptLetter query.
rstStudent.Open " qStudentAcceptLetter ", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
I modified this code from the Access 2002 VBA step by step book and it works fine in the training example but not in the converted DB.
Any help VERY greatly appreciated. This is driving me crazy!
I have attached the whole sub as a txt file