Question

B

Bianca

Hello,
I have created a product table with Article number, category, type and
price. Then I hava another created a customer form (from another table) with
all the customer information, here I have a subform (datasheet) where I enter
orders the customer has placed (using the product table) - my question is
this - is it possible to enter only the Article Number and then have the
category, type and price fields fill in automatically?
Thanks in advance
Bianca
 
O

Ofer Cohen

Look at this link on "Use the Column Property of a Combo Box"
http://www.mvps.org/access/forms/frm0058.htm

Use a combo, that include all fields needed from the table, then use the
example above to populate the rest of the fields to the form.
It's better using a combo, that way by limiting the combo the user can't
make mistakes selecting Article number that doesn't exist

Note: the column number start with 0.
 
B

Bianca

Hi
I checked out the site and I did what it said up to
' ***** Code Start *****
SELECT ID, LastName
FROM tblPersons
ORDER BY ID;
' ***** Code End *****
Set the Bound Column property of cboPersonID to 1.
Set the Column Count property to 2.
Set the Column Widths property to this expression: 1";0".
HERE (I am not yelling)

Where does this go??
Set the Control Source of a textbox (assume it's named txtPersonName) to
this expression:

=[cboPersonID].[Column](1)

Thanks again
Bianca
 
D

Douglas J. Steele

Select the relevant text box and go to the Properties window. Put

=[cboPersonID].[Column](1)

as the ControlSource property for the control.

Alternatively, you can create an event procedure for the AfterUpdate event
of the combo box, and use something like:

Private Sub cboPersonID_AfterUpdate()

Me.MyTextbox = Me.cboPersonID.Column(1)

End Sub


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Bianca said:
Hi
I checked out the site and I did what it said up to
' ***** Code Start *****
SELECT ID, LastName
FROM tblPersons
ORDER BY ID;
' ***** Code End *****
Set the Bound Column property of cboPersonID to 1.
Set the Column Count property to 2.
Set the Column Widths property to this expression: 1";0".
HERE (I am not yelling)

Where does this go??
Set the Control Source of a textbox (assume it's named txtPersonName) to
this expression:

=[cboPersonID].[Column](1)

Thanks again
Bianca
Ofer Cohen said:
Look at this link on "Use the Column Property of a Combo Box"
http://www.mvps.org/access/forms/frm0058.htm

Use a combo, that include all fields needed from the table, then use the
example above to populate the rest of the fields to the form.
It's better using a combo, that way by limiting the combo the user can't
make mistakes selecting Article number that doesn't exist

Note: the column number start with 0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top