Continuous Form Breaks Control Buttons?

ChubbChubb

New member
Local time
Today, 18:39
Joined
Nov 25, 2005
Messages
5
Hi folks,

I've got two control buttons ('OK' and 'Cancel') on several forms. They work on the forms in Single Form view, but not on the one form that is in Continuous Form view. I couldn't find any mention of this behavior on this forum, but on another forum somebody mentioned that Continuous Form view makes control buttons do odd things. Any ideas on how to handle this?

Here's the code:

Private Sub OK_Click()
On Error GoTo Err_OK_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Visible = False

Exit_OK_Click:
Exit Sub

Err_OK_Click:
MsgBox Err.Description
Resume Exit_OK_Click
End Sub

Private Sub Cancel_Click()
DoCmd.Close acForm, "Glossary"
End Sub
 
Where are the buttons located? In the form's Detail section (with a set of buttons for every record)?

I usually put a Footer on my continuous forms for placement of command buttons. Haven't seen any odd behavior when doing this.
 
Plus, get rid of
Code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

and use
Code:
DoCmd.RunCommand acCmdSaveRecord
instead as the code you're using is dependent on version number and you may find that as you upgrade to other versions of Access that it eventually will not work.

Also, just as an FYI - unless you have code in the Before Update event to cancel the record, Access will save the data automatically anyway whenever you go to another record or close the form. The Save Record is actually redundant and not necessary if you do not have code to cancel the automatic record update.
 
Last edited:
The buttons were in the footer. I gave up and just deleted them.

But thanks for the tip regarding the more robust Save command. I don't know if it's redundant or what, but I had to add that line because the new records weren't saving after 'OK,' and my requeries on another form weren't working properly without it.
 

Users who are viewing this thread

Back
Top Bottom