Combo/list Box populating

nadsys

Registered User.
Local time
Today, 19:39
Joined
Apr 22, 2005
Messages
18
hello,

program is ment to take details from a combo box, then from the selection made in the combo box, show details that come from a table in a list box on same form. then from that list box the user picks which record he wants displayed and it populates 4 text fields with relevant record's details.

i have the combo box populated with machine name's from a table. (pss1, pss2,pss3 etc)
i have the list box populated with the date from another table (fields in this table consist of date, comments, updates performed, config change, log entry)

my problem is this: how do i click on the machine name from the combo box and have it display the relevant data from the Date field in the list box? im guessing its an OnClick event, but my vb skills are limited. it needs to find all records relating to pss1 for example and show the relevant data from date field in that list box. then another OnClick event from the list box, when they click a date, it takes the other 4 fields data and puts it into 4 seperate text box's.

i know this isn't hard but im lost as to how to proceed.

Thank You for any guidance.

example of how it looks

machine name(combo box): pss1, pss2, pss3 etc

date of maintenance (list box): 22/05/05, 02/06/05, 03/07/05

comments(text box): whatever it is from the record
updates performed (text box): whatever it is from the record
config change(text box): whatever it is from the record
log entry(text box): whatever it is from the record

:)
 
you need to link the list box to the combo box by a certain field.

So a field that is in both sets of tables. Lets say this is "FIELD1".

In the combo box you need to know where this field is displayed, and have this field bound to the combo box. The reason for this when you relate the list box to the combo box it will pick up this value.

Lets say the combo box name is "cmb1" and your form name is "FORM1".

And lets say your list box is called "LST1"

Go into the list rowsource, and under FIELD1 in the criteria you would need to type this

[forms]![FORM1]![cmb1]

Save this, and then go back to the form

On the combo box, go into the event procedure for the on_click, and you would need to type the following:

LST1.Requery.

And that should work.

Any issue please let me know, or you could post your db and i will modify if for you and post it back.
 
Last edited:
many thanx but still issues remain

got an error on runtime. i have attached program for you too take a look. really appreciate this.

(and my mate who im doing this for will be even more grateful).
 

Attachments

bump

still looking to resolve this issue, any help much appreciated.
 
calling m8kwr...beep...beep hehe

tried a few different approach's from examples i found. but no no avail. i have two tables + two queries. i still cant get the second combo box to be populated by my choice in combo box 1. once i can achieve that then the next step would be easy.

i attach my latest attempt (also unsure of relationships i need to create)

thank you for any advice/coding
 

Attachments

Users who are viewing this thread

Back
Top Bottom