If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Question regarding subform
I have a form (orders) with a subform (order details). The subform has the
item, quantity, unit price and discount. The item is a combo box via a query and places the appropriate item in the field, I am trying to pull the unit price automatically but do not want to do it via a combo box as that may lead to errors and I've already made the selection. Unit price is currently set to be a text field control, do I need a different control instead of this? Thanks in advance |
#2
|
|||
|
|||
Question regarding subform
On Sat, 2 Dec 2006 13:47:50 -0500, "Dominic"
wrote: I have a form (orders) with a subform (order details). The subform has the item, quantity, unit price and discount. The item is a combo box via a query and places the appropriate item in the field, I am trying to pull the unit price automatically but do not want to do it via a combo box as that may lead to errors and I've already made the selection. Unit price is currently set to be a text field control, do I need a different control instead of this? Thanks in advance You can "push" the unit price from the items table into a textbox, using the combo. Just include the (current) unit price in the combo's RowSource query, and set the combo's column count big enough to include it. You can use the ColumnWidths property of the combo to conceal the price from the dropdown. In the combo's AfterUpdate event put code like Private Sub cboItemID_AfterUpdate() Me.txtUnitPrice = Me.cboItemID.Column(2) End Sub This will copy the price of the selected item from the *third* (it's zero based) column of the combo into a textbox named txtUnitPrice. John W. Vinson[MVP] |
#3
|
|||
|
|||
Question regarding subform
Thanks, that worked perfectly
"John Vinson" wrote in message ... On Sat, 2 Dec 2006 13:47:50 -0500, "Dominic" wrote: I have a form (orders) with a subform (order details). The subform has the item, quantity, unit price and discount. The item is a combo box via a query and places the appropriate item in the field, I am trying to pull the unit price automatically but do not want to do it via a combo box as that may lead to errors and I've already made the selection. Unit price is currently set to be a text field control, do I need a different control instead of this? Thanks in advance You can "push" the unit price from the items table into a textbox, using the combo. Just include the (current) unit price in the combo's RowSource query, and set the combo's column count big enough to include it. You can use the ColumnWidths property of the combo to conceal the price from the dropdown. In the combo's AfterUpdate event put code like Private Sub cboItemID_AfterUpdate() Me.txtUnitPrice = Me.cboItemID.Column(2) End Sub This will copy the price of the selected item from the *third* (it's zero based) column of the combo into a textbox named txtUnitPrice. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|