-
Query Help
Hi,
I'm actually trying to help a friend out, I've used access as a database for Visual Basic, but barely using its design view.
This is the table were working with
table name: Work Centre For Printing
primary key | Work Centre Name | Work Centre Description
10 | LAM | Lamintor
11 | P-10 | Comexi 1
12 | P-11 | Printing Machine No. 11
in his form he has 2 combo boxes, named cbWorkCentre and cbWCD
in Row Source for cbWorkCentre its: SELECT [Work Centre Name] FROM [Work Centre For Printing];
what were trying to do is when a value is selected in cbWorkCentre say P-10 in cbWCD 'Comexi 1' should come up or if its P-11 , in cbWCD 'Printing Machine No. 11' should come up.
so for the row source in Work Centre Description, how can I write this?
So far I've come up with,
SELECT [Work Centre Description] FROM [Work Centre For Printing] WHERE [Work Centre Name]=cbWorkCentre.Text;
but i get no luck
any help is appreciated
thx
-
If you just want to display the description, add it to the row source of the first combo, change the column count property to 2 and have this as the control source of a textbox:
=cbWorkCentr.Column(1)
The column property is zero based, so 1 refers to the second column.
-
thanx mate, worked like a charm
-
No problem, and welcome to the site by the way!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules