Hiding buttons on form when in ADD but not when in EDIT

Carl_R

Registered User.
Local time
Today, 11:08
Joined
Aug 16, 2002
Messages
82
Hi

I am using a standard access switchboard (Access 97)

On my main form I have several custom buttons for navigation, deleting, copying records etc.

The first button on the switchboard opens my main form in ADD mode ie. a blank form.
The second button opens the same form but in EDIT mode ie. the user is presented with the last record which was populated with data and can move to all other records via the custom navigation buttons.

What I am finding tricky is hiding all of my custom navigation buttons when the form is opened in ADD mode. Saying this, the user is unable to navigate in ADD mode anyway - I just want to make the form clean and uncomplicated for our users...

Any suggestions most welcome.
 
Sub Form_Current()
On Error GoTo Form_Current_Err

Me.txtCurrRec = Form.CurrentRecord
Me.txtTotalRecs = Form.RecordsetClone.RecordCount + IIf(Form.NewRecord, 1, 0) & " " & "(filtered)"



If NewRecord = True Then
Me.Label81.Visible = False
Me.ToggleLink.Visible = False
Me.Command85.Visible = False
Me.Command78.Visible = False
Me.Command82.Visible = False
Me.Command88.Visible = False
txtPMID.SetFocus
Else:
Me.Label81.Visible = True
Me.ToggleLink.Visible = True
Me.Command85.Visible = True
Me.Command82.Visible = True
Me.Command78.Visible = True
Me.Command88.Visible = True
End If


Form_Current_Exit:
Exit Sub

Form_Current_Err:

MsgBox Error$
Resume Form_Current_Exit


End Sub
 
Sorted. :)
Thanks Rich
 
Rich,

PHP:
Me.txtCurrRec = Form.CurrentRecord 
Me.txtTotalRecs = Form.RecordsetClone.RecordCount 
+ IIf(Form.NewRecord, 1, 0) & " " & "(filtered)"

What does this part of the code do?
 
It just displays (filtered) in the textbox as well as the total number of records displayed
 

Users who are viewing this thread

Back
Top Bottom