Sam92Legacy
Technical User
I have a script which runs a make table query, then runs an update query, and finally prints a report. The query worked without a hitch on a the first computer I used (AccessXP), but I get an error message during the update query that says "The expression is typed incorrectly, or is too complex to be evaluated." on the computer I imported it to (Also running AccessXP). I can run the queries without a problem when I run them outside of the script, however.
The update query is:
UPDATE (Main INNER JOIN [Pledge Sum] ON Main.ContactID = [Pledge Sum].ContactID) INNER JOIN Events ON (Main.ContactID = Events.ContactID) AND ([Pledge Sum].ContactID = Events.ContactID) SET Events.EventCode = [Pledge Sum]![Amount]
WHERE (((Events.Event)=[Pledge Sum]![LastOfSource]));
and the script is:
Dim stDocName As String
DoCmd.SetWarnings True
'run the make table query
DoCmd.OpenQuery ("PledgeSummary"
'run the update query
DoCmd.OpenQuery ("EventCodeUpdate"
stDocName = "Events"
DoCmd.OpenReport stDocName, acPreview
Any suggestions on where I went wrong would be much appreciated.
Thanks,
Sam
The update query is:
UPDATE (Main INNER JOIN [Pledge Sum] ON Main.ContactID = [Pledge Sum].ContactID) INNER JOIN Events ON (Main.ContactID = Events.ContactID) AND ([Pledge Sum].ContactID = Events.ContactID) SET Events.EventCode = [Pledge Sum]![Amount]
WHERE (((Events.Event)=[Pledge Sum]![LastOfSource]));
and the script is:
Dim stDocName As String
DoCmd.SetWarnings True
'run the make table query
DoCmd.OpenQuery ("PledgeSummary"
'run the update query
DoCmd.OpenQuery ("EventCodeUpdate"
stDocName = "Events"
DoCmd.OpenReport stDocName, acPreview
Any suggestions on where I went wrong would be much appreciated.
Thanks,
Sam