Command buttons stopped responding

F

Fiona MacD

I know I must have done something really stupid to my database cause it was
working fine before and now none of the command buttons respond and I can't
even open the switchboard form! I tried to recreate a somple cancel button
and the first time I make the button it works. If I go and rename the
control it stops working. Then if I go back and rename it to the original
control name it still won't work.

I am almost finished with the database design and population and was about
ready to unleash users on it when this started happening and I have no clue
where to begin! Help!!!!
 
N

Nikos Yannacopoulos

Fiona,

You're not providing enough info. Post back form and button details
(names, what the button is supposed to do etc.), and code behind button.

Regards,
Nikos
 
F

Fiona MacD

Hmm lets see, I have a form called frmCTLookup and it has a command button
called cmdCancel on it. So I set the properties on the button for cancel and
then built some code to simply close the form when it is clicked:

Private Sub cmdCancel_Click()
DoCmd.Close acForm, "frmCTLookup"
End Sub

I have a test database (thank goodness) that this still works on, but
setting up the same thing on my live database - the cancel button does
nothing when I click on it.

I have a Switchboard set up and if from the form view I click open in design
I can see the form, but if I try and open it to use it nothing happens.
Wierdest thing I have seen!
 
N

Nikos Yannacopoulos

Fiona,

See below.

HTH,
Nikos

Fiona said:
Hmm lets see, I have a form called frmCTLookup and it has a command button
called cmdCancel on it. So I set the properties on the button for cancel and
then built some code to simply close the form when it is clicked:

Private Sub cmdCancel_Click()
DoCmd.Close acForm, "frmCTLookup"
End Sub
Is it the command button you renamed? If yes, did you then make sure
there is a procedure similar to the above whose name reflects the new
command button name, like:
Private Sub NewCmdButtonName_Click()
DoCmd.Close acForm, "frmCTLookup"
End Sub
I have a test database (thank goodness) that this still works on,
Good! You just saved me the "always keep a backup and test on a copy"
lecture!


but
setting up the same thing on my live database - the cancel button does
nothing when I click on it.
One: check as above. Two: if the code was copied from somewhere else
too, make sure the form name is the actual one! If the code is supposed
to close the form it belongs to, the easiest and safest way is:
DoCmd.Close acForm, Me.Name
 
F

Fiona MacD

Thanks for your help with this Nikos. I did check that the code had the
correct new came for the control and then I tried your suggestiong of using
the Me.Name code. It still does nothing when you click the cancel button
though.

I think what I will do is copy the data tables from the not working dB over
to the working test dB and recreate the last bunch of changes I made and
either figure out what thing broke it all or have it work wonderfully and
make 50 backups 'just in case'!!!

Cheers,
Fiona
 
N

Nikos Yannacopoulos

Fiona,

If you want, you are welcome to e-mail me your database to have a look,
just Compact and Repair (and if possible also zip) please. My address is
available here, just do the obvious.

HTH,
Nikos
 

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