Price Lookup using Combo Box - Blues

dynamictiger

Registered User.
Local time
Today, 06:59
Joined
Feb 3, 2002
Messages
270
I have a subform set up as an order detail form. This contains a combo box with details like Part Number, Description, Price.

When the user updates the combo bx by selecting the appropriate description, I want to populate the column Part Number, and price appropriately.

To achieve this I am using Me.PartNumber=Me.ComboBox.Column(x) method.

Part Number is bound to the OrderDetail table, as I think we may delete the part number at some future date from the combobox source table.

Price is not bound. When I select the record in the combobox it updates ALL prices in the price field to the current record. I am looking for a way to prevent this, that is to force the price to be the price returned by the current row to the current row only.
 
D,

You can run an update query that will change the current record's field value in the table underneath the subform. Perhaps something like the following.

Private Sub cboYourName_AfterUpdate()

Dim StrSQL as string

strSQL = "Paste SQL here for Update Query that you tested _ using a copy of your database and the Access query screen"

Docmd.Setwarnings False
Docmd.RunSQL strSQL
Docmd.Setwarnings true

End sub

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom