R
rpw
Hi everyone, a couple of questions:
First, I have one mdb that when the form is in form view, the Form Design
and the Form View tool bars are deactivated. In my other mdb's that is not
the case. With those toolbars deactivated, the only way to switch to form
design view is via the 'Design' button on the main database window. Is there
a setting somewhere to change the toolbars to active?
Second, in this same mdb I have a form with Allow Edits and Allow Additions
set to false, a command button (Modify) that changes those parameters to
true, and another two (Save, Cancel) that changes them back to false.
However, when the form first opens, no data can be changed, yet after
clicking Modify then Save or Cancel, the data can be changed - i.e. the two
parameters in question must still be set to true. I can't verify this
because along with the Form Design toolbar being deactivated, the Parameters
window is gone.
I have tried copying the form and using the new copy, but that kept the same
behavior. Any other 'tricks' that I might try?
The form has a tab control with four tabs. Two of the tabs have subforms.
One subform has a subform and the other has two subforms. Interestingly, the
subform's behavior is opposite the forms behavior (as far as allowing edits).
I don't know if the code will be of any help but here it is:
Private Sub cmdCancel_Click()
Me.Undo
Me.AllowAdditions = False
Me.AllowEdits = False
Me.sfrmCffcMatSales.Form.AllowAdditions = False
Me.sfrmCffcMatSales.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowAdditions = False
cmdAddNew.Visible = True
cmdPrevious.Visible = True
cmdNext.Visible = True
cmdModify.Visible = True
cmdExit.Visible = True
cboSelectLocation.Visible = True
lblSelectLocation.Visible = True
cboSelectLocation.SetFocus
cmdSave.Visible = False
cmdCancel.Visible = False
End Sub
Private Sub cmdModify_Click()
Me.AllowEdits = True
cmdSave.Visible = True
cmdCancel.Visible = True
Me.sfrmCffcMatSales.Form.AllowAdditions = True
Me.sfrmCffcMatSales.Form.AllowEdits = True
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowEdits = True
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowAdditions = True
cmdSave.SetFocus
cmdAddNew.Visible = False
cmdPrevious.Visible = False
cmdNext.Visible = False
cmdModify.Visible = False
cmdExit.Visible = False
cboSelectLocation.Visible = False
lblSelectLocation.Visible = False
End Sub
Private Sub cmdSave_Click()
Me.AllowAdditions = False
Me.AllowEdits = False
cmdAddNew.Visible = True
cmdPrevious.Visible = True
cmdNext.Visible = True
cmdModify.Visible = True
Me.sfrmCffcMatSales.Form.AllowAdditions = False
Me.sfrmCffcMatSales.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowAdditions = False
cmdExit.Visible = True
cboSelectLocation.Visible = True
lblSelectLocation.Visible = True
cboSelectLocation.SetFocus
cmdSave.Visible = False
cmdCancel.Visible = False
End Sub
Thanks for any help provided.
First, I have one mdb that when the form is in form view, the Form Design
and the Form View tool bars are deactivated. In my other mdb's that is not
the case. With those toolbars deactivated, the only way to switch to form
design view is via the 'Design' button on the main database window. Is there
a setting somewhere to change the toolbars to active?
Second, in this same mdb I have a form with Allow Edits and Allow Additions
set to false, a command button (Modify) that changes those parameters to
true, and another two (Save, Cancel) that changes them back to false.
However, when the form first opens, no data can be changed, yet after
clicking Modify then Save or Cancel, the data can be changed - i.e. the two
parameters in question must still be set to true. I can't verify this
because along with the Form Design toolbar being deactivated, the Parameters
window is gone.
I have tried copying the form and using the new copy, but that kept the same
behavior. Any other 'tricks' that I might try?
The form has a tab control with four tabs. Two of the tabs have subforms.
One subform has a subform and the other has two subforms. Interestingly, the
subform's behavior is opposite the forms behavior (as far as allowing edits).
I don't know if the code will be of any help but here it is:
Private Sub cmdCancel_Click()
Me.Undo
Me.AllowAdditions = False
Me.AllowEdits = False
Me.sfrmCffcMatSales.Form.AllowAdditions = False
Me.sfrmCffcMatSales.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowAdditions = False
cmdAddNew.Visible = True
cmdPrevious.Visible = True
cmdNext.Visible = True
cmdModify.Visible = True
cmdExit.Visible = True
cboSelectLocation.Visible = True
lblSelectLocation.Visible = True
cboSelectLocation.SetFocus
cmdSave.Visible = False
cmdCancel.Visible = False
End Sub
Private Sub cmdModify_Click()
Me.AllowEdits = True
cmdSave.Visible = True
cmdCancel.Visible = True
Me.sfrmCffcMatSales.Form.AllowAdditions = True
Me.sfrmCffcMatSales.Form.AllowEdits = True
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowEdits = True
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowAdditions = True
cmdSave.SetFocus
cmdAddNew.Visible = False
cmdPrevious.Visible = False
cmdNext.Visible = False
cmdModify.Visible = False
cmdExit.Visible = False
cboSelectLocation.Visible = False
lblSelectLocation.Visible = False
End Sub
Private Sub cmdSave_Click()
Me.AllowAdditions = False
Me.AllowEdits = False
cmdAddNew.Visible = True
cmdPrevious.Visible = True
cmdNext.Visible = True
cmdModify.Visible = True
Me.sfrmCffcMatSales.Form.AllowAdditions = False
Me.sfrmCffcMatSales.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowEdits = False
Me.sfrmCffcMatSales.Form.sfrmMatSalePymts.Form.AllowAdditions = False
cmdExit.Visible = True
cboSelectLocation.Visible = True
lblSelectLocation.Visible = True
cboSelectLocation.SetFocus
cmdSave.Visible = False
cmdCancel.Visible = False
End Sub
Thanks for any help provided.