469,322 Members | 1,583 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

drop down list fill in a form

20
I have two tables, one called customers and the other called products. I would like to create a form called orders.

On here what i would like to do, is a drop down list for the customer ID. When the customer ID is selected the rest of the fields get filled in with the correct details. So their firstname, lastname, address etc get put into the fields.

Same for products as well.

How do i do this?
Sep 7 '07 #1
1 1354
hjozinovic
167 100+
hi there!

You should make a query that contains all the info you want to be filled in automatically i.e. (CustomerID, Fname, Lname...)
Open combobox's property list:
-Set Bound column property to: 1
-set Column count property to: 3 (or the number of fields in your query)
-set Column widths to: 5;0;0 (only first column will be displayed-5cm, and the other two will not be displayed, but they will be present though)

In combobox's after update event property write code like this:

Me!Fname=Me!CustomerID.Column(1)
Me!Lname=Me!CustomerID.Column(2)

note that 1st column has index 0, 2nd has index 1 (Fname)...

For more info you can search the Column property in Microsoft Visial basic help!

Best, H.
Dec 11 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Richard Galli | last post: by
reply views Thread by owyn | last post: by
2 posts views Thread by ramesh | last post: by
reply views Thread by Giulio Santorini | last post: by
3 posts views Thread by Stephen Adam | last post: by
3 posts views Thread by pmud | last post: by
1 post views Thread by csgraham74 | last post: by
2 posts views Thread by kalaivanan | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.