Command button errors in forms

S

Stephen @ ZennHAUS

Hi Guys and Gals

This is kind of a revisited topic. Please refer to my post on 15/12/2008
entitled Errors loading/opening forms using command buttons.

The problem I am having is similar to the previous issue. Last time I
created forms in 2007 and when I used them in 2003 the error occurred as
described in the previous post. That was solved by creating a fresh
database in 2003 on a machine with only 2003 installed. Immediately
upgrading the database to 2003 format, then copying all of the data
structures from the old database without any code.

This case is a little different. I am still working in the new database
created in 2003 and am creating all the forms and code to drive the
interface. I created "Form A" as a blank form in design view. It has a
subform "Form A.S" in datasheet view, a label and a command button as the
only 3 controls on the form. The command button was created with the Command
Button control wizard and it's only job is to close the form. The command
button uses the following code:

Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click


DoCmd.Close

Exit_cmdClose_Click:
Exit Sub

Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click

End Sub

"Form A" and "Form A.S" were both copied and modified to become "Form B",
"Form B.S" and "Form C", "Form C.S". The label was changed in both forms B
and C and the data source and fields were changed on forms B.S and C.S.

All 3 forms were working fine from the menu interface, again activated by
command buttons. After noticing a mistake in the label on form A, I changed
the label, saved the form and then previewed the form in form view. When I
clicked the Close button, I got the attached error. If the attachment does
not work, the error is fully transcribed in the previous post already
mentioned.

** it seems my initial posting of this message was rejected because my post
** contained an attached file. Please refer to my post from 15 Dec 2008 as
** mentioned earlier in this post for a full transcript of the error
message.

Forms B and C still work perfectly. I have deleted, recreated and compiled
the code in Form A, deleted the command button and recreated it from
scratch. Nothing seems to fix it. I am not inclined to recreate the form
from scratch because I have so many more forms to create, if this happens
again, I need to know how to resolve it.

Cheers

Stephen @ ZennHAUS
 
B

banem2

Hi Guys and Gals

This is kind of a revisited topic.  Please refer to my post on 15/12/2008
entitled Errors loading/opening forms using command buttons.

The problem I am having is similar to the previous issue. Last time I
created forms in 2007 and when I used them in 2003 the error occurred as
described in the previous post.  That was solved by creating a fresh
database in 2003 on a machine with only 2003 installed. Immediately
upgrading the database to 2003 format, then copying all of the data
structures from the old database without any code.

This case is a little different. I am still working in the new database
created in 2003 and am creating all the forms and code to drive the
interface.  I created "Form A" as a blank form in design view. It has a
subform "Form A.S" in datasheet view, a label and a command button as the
only 3 controls on the form. The command button was created with the Command
Button control wizard and it's only job is to close the form. The command
button uses the following code:

Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click

    DoCmd.Close

Exit_cmdClose_Click:
    Exit Sub

Err_cmdClose_Click:
    MsgBox Err.Description
    Resume Exit_cmdClose_Click

End Sub

"Form A" and "Form A.S" were both copied and modified to become "Form B",
"Form B.S" and "Form C", "Form C.S".  The label was changed in both forms B
and C and the data source and fields were changed on forms B.S and C.S.

All 3 forms were working fine from the menu interface, again activated by
command buttons. After noticing a mistake in the label on form A, I changed
the label, saved the form and then previewed the form in form view.  When I
clicked the Close button, I got the attached error. If the attachment does
not work, the error is fully transcribed in the previous post already
mentioned.

** it seems my initial posting of this message was rejected because my post
** contained an attached file. Please refer to my post from 15 Dec 2008 as
** mentioned earlier in this post for a full transcript of the error
message.

Forms B and C still work perfectly. I have deleted, recreated and compiled
the code in Form A, deleted the command button and recreated it from
scratch. Nothing seems to fix it. I am not inclined to recreate the form
from scratch because I have so many more forms to create, if this happens
again, I need to know how to resolve it.

Cheers

Stephen @ ZennHAUS

Hi,

See my recent advice in your previous post - export forms as text and
search and remove "Unknow Properties" (looks like you have used,
created or edit forms in Access 2007 before downgrading).

Regards,
Branislav Mihaljev
Microsoft Access MVP
 
S

Stephen @ ZennHAUS

Nope ... not this time. No 2007 in sight. Created everything except the
tables from scratch. The tables were imported from the old 2003 format
database which had been used in 2007. But this database has not been used,
modified or even looked at in 2007. The computer it is being created on has
never seen 2007.
 

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