Problems with Form Save Command Button

  • Thread starter Thread starter PeteMacaulay
  • Start date Start date
P

PeteMacaulay

Hi There,

Am doing some basic forms in an Access Project.

Would like to add a Cancel command button and a Save/Close command
button to form.

Using the Command Button wizard I add a Close Form command
'docmd.close'. This seems pretty straightforward but produces an error
along the lines of;

The expression On Click you entered as the event property setting
produced an error while communicating with the OLE Server or ActiveX
control .... yadayada.

Can anyone help me with this please?

Cheers,

Peter Macaulay
 
Hi There,

Am doing some basic forms in an Access Project.

Would like to add a Cancel command button and a Save/Close command
button to form.

Using the Command Button wizard I add a Close Form command
'docmd.close'. This seems pretty straightforward but produces an error
along the lines of;

The expression On Click you entered as the event property setting
produced an error while communicating with the OLE Server or ActiveX
control .... yadayada.

Can anyone help me with this please?

Cheers,

Peter Macaulay
 
Given the error you're getting, I'm assuming this isn't the problem, but
just in case...the Close command takes a couple of parameters. In its most
basic form, what you want is

DoCmd.Close acForm, Me.Name 'or type in the name of your form, but
Me.Name works even if you change the name, so it's good practice.

It sounds to me more like you might have a broken reference or something of
that nature. Try decompiling the project and re-compiling it, and see if
that narrows it down at all. (To decompile, run Access.exe from the start
line with the following parameters ...MSAccess.exe "MyProject.adp"
/decompile)


Rob
 
I've had the same problem.
The only way I could correct the fault was to create a new blank database,
and then import the original tables, forms etc into it.
Hope this helps
 
Back
Top