Combo Box Help- Inventory Auto Fill

Jessica02

New member
Local time
Today, 18:24
Joined
May 13, 2017
Messages
2
I am trying to create a database for inventory. I want to have a table that lists the product ID, product name and cost. Then I would like a form that I can enter the product ID and it will auto fill the product name and cost into that form- where I can add additional information (quantity in stock etc). I have tried every help document I can find with no luck... I got the form and combo box created but keep getting an error message with my code.
 
Set up an unbound combo Box. Name is whatever you like, substitute your name below instead of cboComboBox. On the form have three fields, ProductID, ProductName and Cost. Use the combo box setup with the table as the data source, selecting the ProductID. ProductName and Cost. Then in the after update of the combo box use:

Code:
  Me.ProductID = cboComboBox.Column(0)
  Me.ProductName = cboComboBox.Column(1)
  Me.Cost = cboComboBox.Column(2)
Just don't name the combo box the same as your Product ID.
 
Here is what I have:

Product Code Table:
ProductID
ProductName
RetailPrice

Inventory Form:

ProductID: As combo box
ProductName
RetailPrice

When I enter the code- the message I get is:

Compile error
Method or data member not found.

Here is the code I entered.
Private Sub Combo7_AfterUpdate()
Me.ProductID = cboComboBox.Column(0)
Me.ProductName = cboComboBox.Column(1)
Me.RetailPrice = cboComboBox.Column(2)
End Sub
 
You have to use the name of your combo, Combo7.
 

Users who are viewing this thread

Back
Top Bottom