subform resetting settings

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a number of forms with the same subform. ie a form for editing, a
similar one for filtering and one for adding new records. I have done this to
help the user see when they are in filter mode to prevent creation of
superfluous records etc.
However, I have set the subform (progress subform) to have no navigation
buttons to make the screen clearer. The Progress form has the properties
Allow edits, deletions and additions set to YES. However, when I view this in
the filtering form it does not allow additions and each time I close the
filtering form, it resets the above properties to no.
I am switching between forms using buttons.
I have tried to delete the subform from the filter form and recreate it
incase I changed a setting, but it is still happening.
What could I be doing wrong? Why does it keep resetting the properties and
how do I stop it?
Any help gratefully received?
 
Lynn,

I am not very clear on the specifics of your situation, but here's an
idea you might want to explore: use the subform's On Open event to check
which form it is being opened in, and set whatever properties
accordingly. Here's an example, which assumes main forms called
frmDisplay, frmEdit and frmAddNew:

Private Sub Form_Open(Cancel As Integer)
Select Case Me.Parent
Case "frmDisplay"
Me.AllowEdits = False
Me.AllowDeletions = False
Me.AllowAdditions = False
Case "frmEdit"
Me.AllowEdits = True
Me.AllowDeletions = False
Me.AllowAdditions = False
Case "frmAddNew"
Me.AllowEdits = True
Me.AllowDeletions = False
Me.AllowAdditions = True
Case Else
Exit Sub
End Select
End Sub

HTH,
Nikos
 
Back
Top