Control Visibility based on other Control

ShredDude

Registered User.
Local time
Today, 07:56
Joined
Jan 1, 2009
Messages
71
I've created a split form. One record's data elements appear at the top, while data sheet of all records in recordset is visbile below.

In the after update event for a combobox on the form I've placed the following code which works well:

Code:
  Private Sub cboJobtype_AfterUpdate()
    'visibility of Binding Combo based on Job type
    Me!cboBinding.Visible = (Nz(Me!cboJobtype.Column(1)) = "Binding")
    Me!lblBinding.Visible = Me!cboBinding.Visible

End Sub

I've placed the same code in the Form's Current Event, and it does not have the desired affect. If I navigate to a new record either via clicking on the data sheet, or using the form's navigation bar, the cboBiding control appears, but not the label, regardless of the records cbojobtype value. It also seems that the cboBinding control doesn't completely appear, it seems to be missing its border. Breaking the code and stepping through indicates the visible properties are indeed being changed appropriately during the From_Current event, but the form does not display the cboBinding control correctly.

Code:
Private Sub Form_Current()
  'visibility of Binding Combo based on Job type
    Me!cboBinding.Visible = (Nz(Me!cboJobtype.Column(1)) = "Binding")
    Me!lblBinding.Visible = Me!cboBinding.Visible
End Sub

Once present, the partially drawn cboBinding will not disappear again based on a record change.

Using the form's cboJobType control to change the value for a particular record results in the intended behavior on the cbo/lblBinding.

I can't explain it. Any ideas?
 
I'm guessing it's the Datasheet part of the Split Form that is behaving badly?
 
I don't know. Is that a known issue?

The upper part of the form is what I was referring to; the "Single Form" Section of the form where I have bound controls.
 
vbaInet:

So, out of curiosity after your reply, I made a copy of the form in question and converted it to a Single Form. Works as intended.

I'm fairly new with Access. Is using the Split Form view known to have "issues"?

Any design advice when the look of the Split Form would be preferable?

thanks,

Shred
 
The Split Form is known to be non programmable so perhaps that's why it's not resonding correctly. I think the idea of using this kind of view is simply for viewing data and that's it. Maybe newer versions of Access will have added features to allow it to be programmable.

The alternative is a Subform.
 

Users who are viewing this thread

Back
Top Bottom