Disable 'New Record' Toolbar button (1 Viewer)

Haynesey

Registered User.
Local time
Today, 17:00
Joined
Dec 19, 2001
Messages
190
Hi,

When the main form opens, I want the 'New Record' button on the toolbar to be disabled as I want to force users to use another button.

However, I can only do this by disabling all the command bars using the following code on the form load:

Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

Is there any more code that will just let me disable one button?

Thanks again

Lee
 

missinglinq

AWF VIP
Local time
Today, 12:00
Joined
Jun 20, 2003
Messages
6,423
In the form's Property Box on the Data tab set Allow Additions to NO

or in code

Code:
Private Sub Form_Load()
   Me.AllowAdditions = False
End Sub

Then in your other button's code to allow a new record

Me.AllowAdditions = True

After the record's saved

Me.AllowAdditions = True

Good Luck
 

Users who are viewing this thread

Top Bottom