E
Eric
I have a form (frmBids) that has a combo box (cboContractType) that
pulls two values from table (domContractType): Column 1 - ID; Column 2
- Name. The bound column is Column 1 (hidden in the combo box) and it
stores the numeric values into tblBids!ContractType. I am using the
combo box selection to make visible a sub-form (sbfBidSubs) located on
a tabbed page (tabBids) further down the form. I set the visible
property on the sub-form to be No by default. I then set the
AfterUpdate properties to make visible the sub-form when the user
selects option 2 (Sub) in the combo box, but not when selecting option
1 (Prime).
Private Sub cboContractType_AfterUpdate()
If Me!cboContractType = 2 Then sbfBidSubs.Visible = True Else
If Me!cboContractType = 1 Then sbfBidSubs.Visible = False
Me!sbfBidSubs.Requery
End Sub
If I am adding a new record, the combo box / sub form display function
works just fine.
The problem arises if I go back into modify a record. If an existing
record has 'Sub' selected in the combo box already, the sub form does
not display. I have to go and select it again from the combo box
before the sub form will display. I would like the sub form to check
automatically if 'Sub' is selected in the combo box and display
without me having to do anything on existing records.
The other problem, which I believe to be related is that the sub form
remains displayed on the new record if I try to add a new record after
viewing an existing record and re-selecting 'Sub' from the combo box
to make the sub form visible on that existing record.
Any thoughts on how I can get this to display correctly?
pulls two values from table (domContractType): Column 1 - ID; Column 2
- Name. The bound column is Column 1 (hidden in the combo box) and it
stores the numeric values into tblBids!ContractType. I am using the
combo box selection to make visible a sub-form (sbfBidSubs) located on
a tabbed page (tabBids) further down the form. I set the visible
property on the sub-form to be No by default. I then set the
AfterUpdate properties to make visible the sub-form when the user
selects option 2 (Sub) in the combo box, but not when selecting option
1 (Prime).
Private Sub cboContractType_AfterUpdate()
If Me!cboContractType = 2 Then sbfBidSubs.Visible = True Else
If Me!cboContractType = 1 Then sbfBidSubs.Visible = False
Me!sbfBidSubs.Requery
End Sub
If I am adding a new record, the combo box / sub form display function
works just fine.
The problem arises if I go back into modify a record. If an existing
record has 'Sub' selected in the combo box already, the sub form does
not display. I have to go and select it again from the combo box
before the sub form will display. I would like the sub form to check
automatically if 'Sub' is selected in the combo box and display
without me having to do anything on existing records.
The other problem, which I believe to be related is that the sub form
remains displayed on the new record if I try to add a new record after
viewing an existing record and re-selecting 'Sub' from the combo box
to make the sub form visible on that existing record.
Any thoughts on how I can get this to display correctly?