Problems with Form Save Command Button

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
 
E

emre ordek

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
 
R

Robert Morley

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
 
T

Tazdaz

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top