C
Carl Colijn
Hi all,
I want to change the design of some of my forms via a VBA routine; to be
specific: I want to clear the RecordSource property. Running this routine
will be part of my roll-out procedure list (I need the RecordSource to be
empty for distribution and later set dynamically in OnLoad, but sometimes
the actual used runtime setting might get saved in when I switch to form
design when modifying the form).
I'm currently using the following technique:
Call DoCmd.OpenForm(sFormName, acDesign)
Forms(sFormName).RecordSource = ""
Call DoCmd.Save(acForm, sFormName)
Call DoCmd.OpenForm(sFormName)
Call DoCmd.Close(acForm, sFormName)
but this invariantly crashes Access with the following error:
Microsoft Visual C++ Runtime Library
Runtime Error!
Program D:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
abnormal program termination
I'm using Access 2003.
Is there an alternative way to set a form's recordsource via VBA code? If I
have to process each form manually before each roll-out, I fear some of them
might slip through from time to time...
Thanks in advance,
Carl Colijn
--
TwoLogs - IT Services and Product Development
A natural choice!
http://www.twologs.com
ShellDispenser: restarting Windows Explorer couldn't be easier!
http://www.twologs.com/en/products/shelldispenser.asp
I want to change the design of some of my forms via a VBA routine; to be
specific: I want to clear the RecordSource property. Running this routine
will be part of my roll-out procedure list (I need the RecordSource to be
empty for distribution and later set dynamically in OnLoad, but sometimes
the actual used runtime setting might get saved in when I switch to form
design when modifying the form).
I'm currently using the following technique:
Call DoCmd.OpenForm(sFormName, acDesign)
Forms(sFormName).RecordSource = ""
Call DoCmd.Save(acForm, sFormName)
Call DoCmd.OpenForm(sFormName)
Call DoCmd.Close(acForm, sFormName)
but this invariantly crashes Access with the following error:
Microsoft Visual C++ Runtime Library
Runtime Error!
Program D:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE
abnormal program termination
I'm using Access 2003.
Is there an alternative way to set a form's recordsource via VBA code? If I
have to process each form manually before each roll-out, I fear some of them
might slip through from time to time...
Thanks in advance,
Carl Colijn
--
TwoLogs - IT Services and Product Development
A natural choice!
http://www.twologs.com
ShellDispenser: restarting Windows Explorer couldn't be easier!
http://www.twologs.com/en/products/shelldispenser.asp