Switchboard Identifier

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

Guest

I was wondering if the switchboard manager can be manipulated so that if I
open a form frmEmployee as an editible form and if I open the same form as an
Add Employee form can I enable/disable certain buttons.

So what I suppose I am asking is if switchboard forms have an identifier and
if so then how to do I find out what it is. If I knew this I suppose I could
make a statement based on the switchboard I am currently in.
 
I was wondering if the switchboard manager can be manipulated so that if I
open a form frmEmployee as an editible form and if I open the same form as an
Add Employee form can I enable/disable certain buttons.

So what I suppose I am asking is if switchboard forms have an identifier and
if so then how to do I find out what it is. If I knew this I suppose I could
make a statement based on the switchboard I am currently in.

Hi Dave,

Sure, we can do that.
However, you do not need to do anything with the Switchboard Manager.
Use the frmEmployee's Open event to test for the DataEntry property of the
form in question. You can use the SBM "Open Form In Add Mode" or
"Open Form In Edit Mode" and designate the same form.

For example, here is some code (not all of it though) in the Open event
of a vendor form in one my projects:

Me.cboSelectCompany.Enabled = Not Me.DataEntry
Me.optDisplay.Enabled = Not Me.DataEntry

If Me.cboSelectCompany.Enabled = True Then
Me.cboSelectCompany.SetFocus
Else
Me.Form.Caption = "Add New Vendor"
Me.lblHeader.Caption = "Add New Vendor"
Me.txtVendorName.SetFocus
End If

So I enable/disable a couple of controls by testing the DataEntry property.
The form's caption is normally "Edit Vendor List", but if the form was
opened in Add Mode from the Switchboard then the form's caption reads
"Add New Vendor."

Hopefully that should help.
 
Back
Top