Have combobox populate textbox and table

Scaniafan

Registered User.
Local time
Today, 04:39
Joined
Sep 30, 2008
Messages
82
Ok, here I am with a new problem :D

I've got a combobox with which the user can select a product. This combobox is based upon the table Products.On selection of a product, a textbox is populated with the price of the product, made possible with the control source =[Product].Column(1). This part works fine.

However, I need the price to be stored in the table InvoiceRules, in the field Price. Somehow, I can't get this to work. I thought, I had to give an AfterUpdate command for the textbox where the price is shown.

Can someone please help me out here?

Thanks already.
 
Last edited:
Look at "DemoCombo2A2000.mdb" (attachment, zip)
Open form and try.
 

Attachments

Thanks, I've just wanted to post that I've solved the issue :D

Where I went wrong was a typing-mistake (is this correct English? I'm from the Netherlands)

Now, with the AfterUpdate set to this:

Private Sub Combo12_AfterUpdate()
Me.Price = Me.Combo12.Column(1)
End Sub

It works. What I had, was a textbox bound to =[Combo12].Column(1). Because it was bound to that, it was not bound to the Price-field in the table.

With the AfterUpdate set correctly, it works fine now :D
 
You can also just add this to your textbox control source.

=[cmboBox].[Column](x)
 

Users who are viewing this thread

Back
Top Bottom