Trouble with A2K DoCmd.Save acReport, sRptName

  • Thread starter david epsom dot com dot au
  • Start date
D

david epsom dot com dot au

I've got code like this (this sample modifies a common
report value):
DoCmd.OpenReport sRptName, acDesign
Set rpt = Reports(sRptName)
For Each ctl In rpt.Controls
If ctl.ControlType = acTextBox Then
If InStr(ctl.ControlSource, "=""Report Prepared") And _
(0 = InStr(ctl.ControlSource, "gfnUserName")) Then
ctl.ControlSource = ctl.ControlSource & " & "", "" & gfnUserName()"
DoCmd.Save acReport, sRptName
endif
endif
next ctl


Problem: In A2K I sometimes get an error like 'cannot continue ...
stop the code and try again' at the DoCmd.Save. I need to SAVE
the CODE PROJECT before it will save the report. Works OK in A97.

does anyone have any insight?

(david)
 
Top