bustersports
Programmer
Hi,
I am trying to have 2 combo boxes requery after data is selected (ex: cboContractFeeCode is 1st combobox, cboOP is the 2nd, and cboDP is the 3rd). When an item is selected in the 3rd box, it is dispositioned, so it does not appear again in the 3rd box.
After selecting item in 1st box (cboContractFeeCode), I want to have the 2nd box (cboOP) required to show related list, the same for cboDP after selecting field in cboOP. This works for me the 1st time, but if I go back to cboOP (as the items from 1st combo box may not have all been dispositioned), the boxes do not requery unless I manually hit F9. Below is the code. Any help or suggestions would be greatly appreciated.
Thanks.
Private Sub cboContractFeeCode_Click()
Requery
[cboOP].Visible = False
[cboDP].Visible = False
[subfrmSelectCharge1].Visible = False
[tabSelectCharge].Visible = False
[tabAccessorials].Visible = False
[tabRates].Visible = False
[txtShipFromPort].Visible = False
[txtShipToPort].Visible = False
[txtCarrier].Visible = False
[cboOP] = Null
[cboDP] = Null
[cboOP].Requery
[cboOP].Visible = True
End Sub
Private Sub cboDP_Click()
Requery
[subfrmSelectCharge1].Requery
[subfrmSelectCharge1].Visible = True
[subfrmSelectCharge2].Requery
[tabSelectCharge].Visible = True
[tabRates].Visible = True
[tabAir].Requery
[tabAccessorials].Requery
[tabCapitalAir].Requery
[tabCapitalGround].Requery
[tabCapitalOcean].Requery
[tabGround].Requery
[tabOcean].Requery
[tabRail].Requery
[tabRMA].Requery
[txtRateTable].Requery
[tabAccessorials].Visible = True
[txtShipFromPort].Visible = True
[txtShipToPort].Visible = True
[txtCarrier].Visible = True
[subfrmSelectCharge2].SetFocus
[pgeAccessorials].SetFocus
[tabAccessorials].[Form]![Rate ID#].SetFocus
End Sub
Private Sub cboOP_Click()
Requery
[cboDP].Visible = False
[cboDP] = Null
[subfrmSelectCharge1].Visible = False
[tabSelectCharge].Visible = False
[tabAccessorials].Visible = False
[tabRates].Visible = False
[txtShipFromPort].Visible = False
[txtShipToPort].Visible = False
[txtCarrier].Visible = False
[cboDP].Requery
[cboDP].Visible = True
End Sub
I am trying to have 2 combo boxes requery after data is selected (ex: cboContractFeeCode is 1st combobox, cboOP is the 2nd, and cboDP is the 3rd). When an item is selected in the 3rd box, it is dispositioned, so it does not appear again in the 3rd box.
After selecting item in 1st box (cboContractFeeCode), I want to have the 2nd box (cboOP) required to show related list, the same for cboDP after selecting field in cboOP. This works for me the 1st time, but if I go back to cboOP (as the items from 1st combo box may not have all been dispositioned), the boxes do not requery unless I manually hit F9. Below is the code. Any help or suggestions would be greatly appreciated.
Thanks.
Private Sub cboContractFeeCode_Click()
Requery
[cboOP].Visible = False
[cboDP].Visible = False
[subfrmSelectCharge1].Visible = False
[tabSelectCharge].Visible = False
[tabAccessorials].Visible = False
[tabRates].Visible = False
[txtShipFromPort].Visible = False
[txtShipToPort].Visible = False
[txtCarrier].Visible = False
[cboOP] = Null
[cboDP] = Null
[cboOP].Requery
[cboOP].Visible = True
End Sub
Private Sub cboDP_Click()
Requery
[subfrmSelectCharge1].Requery
[subfrmSelectCharge1].Visible = True
[subfrmSelectCharge2].Requery
[tabSelectCharge].Visible = True
[tabRates].Visible = True
[tabAir].Requery
[tabAccessorials].Requery
[tabCapitalAir].Requery
[tabCapitalGround].Requery
[tabCapitalOcean].Requery
[tabGround].Requery
[tabOcean].Requery
[tabRail].Requery
[tabRMA].Requery
[txtRateTable].Requery
[tabAccessorials].Visible = True
[txtShipFromPort].Visible = True
[txtShipToPort].Visible = True
[txtCarrier].Visible = True
[subfrmSelectCharge2].SetFocus
[pgeAccessorials].SetFocus
[tabAccessorials].[Form]![Rate ID#].SetFocus
End Sub
Private Sub cboOP_Click()
Requery
[cboDP].Visible = False
[cboDP] = Null
[subfrmSelectCharge1].Visible = False
[tabSelectCharge].Visible = False
[tabAccessorials].Visible = False
[tabRates].Visible = False
[txtShipFromPort].Visible = False
[txtShipToPort].Visible = False
[txtCarrier].Visible = False
[cboDP].Requery
[cboDP].Visible = True
End Sub