D
David C. Holley
I'm trying to change the default value of a comboBox via code. The
problem that I'm having is that the default value is not being displayed
in the combobox [cboBillingMethod] nor is it being stored in the record.
I have confirmed that the code is functioning properly in that the
default values for [cboClient] and [cboMasterAccount] are being set AND
are being used when a new record is added. When I checked the default
value of [cboBillingMethod] via the immediate window, it is being set -
its just not being used.
So what am I missing?
David H
DoCmd.OpenForm "frmReservations", acNormal, , , acFormAdd
Select Case [Forms]![frmInvoicing]![txtAccountType]
Case "client"
[Forms]![frmReservations]![cboBillingMethod].DefaultValue = "client"
[Forms]![frmReservations]![cboBillingMethod].Value = "client"
[Forms]![frmReservations]![cboClient].DefaultValue =
[Forms]![frmInvoicing]![lngClientID]
[Forms]![frmReservations]![cboClient].Value =
[Forms]![frmInvoicing]![lngClientID]
Case "master account"
[Forms]![frmReservations]![cboBillingMethod].DefaultValue = "master"
[Forms]![frmReservations]![cboBillingMethod].Value = "master"
[Forms]![frmReservations]![cboMasterAccount].DefaultValue =
[Forms]![frmInvoicing]![lngMasterAccountID]
[Forms]![frmReservations]![cboMasterAccount].Value =
[Forms]![frmInvoicing]![lngMasterAccountID]
End Select
problem that I'm having is that the default value is not being displayed
in the combobox [cboBillingMethod] nor is it being stored in the record.
I have confirmed that the code is functioning properly in that the
default values for [cboClient] and [cboMasterAccount] are being set AND
are being used when a new record is added. When I checked the default
value of [cboBillingMethod] via the immediate window, it is being set -
its just not being used.
So what am I missing?
David H
DoCmd.OpenForm "frmReservations", acNormal, , , acFormAdd
Select Case [Forms]![frmInvoicing]![txtAccountType]
Case "client"
[Forms]![frmReservations]![cboBillingMethod].DefaultValue = "client"
[Forms]![frmReservations]![cboBillingMethod].Value = "client"
[Forms]![frmReservations]![cboClient].DefaultValue =
[Forms]![frmInvoicing]![lngClientID]
[Forms]![frmReservations]![cboClient].Value =
[Forms]![frmInvoicing]![lngClientID]
Case "master account"
[Forms]![frmReservations]![cboBillingMethod].DefaultValue = "master"
[Forms]![frmReservations]![cboBillingMethod].Value = "master"
[Forms]![frmReservations]![cboMasterAccount].DefaultValue =
[Forms]![frmInvoicing]![lngMasterAccountID]
[Forms]![frmReservations]![cboMasterAccount].Value =
[Forms]![frmInvoicing]![lngMasterAccountID]
End Select