Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autopopulate data

Status
Not open for further replies.

lywong111

Programmer
Apr 4, 2004
13
US
Hi,

I have a form with 2 cmbbox1 and cmbbox2.
Both are bound to a table.

How do i do such that when I click cmbbox1, cmbbox2 will show all data related to cmbbox1 and then after select the desired option from cmbbox2, both will save into the tbl.

EG: cmbox1 values are: Red, Green, Yellow
after select 'Red'
cmbbox2 will give values as: apple, strawberry, tomato

Pls advice? Thanks.
 
Hi Ken,

Then how do you set the value in cmbbox2 to the first record listed instead of a blank one in cmbbox2 when it first started to requery?
 
Hi

I do not know your control nmaes etc so I cannot give exact answer, but something like

If cmbbox2.ListCount > 0 Then
cmbbox2 = cmbbox2.column(0)
End if

if you are talking about setting the initial value of teh combo to the first value in the list

cmbbox2 = MyTextControl

if you are talking of setting it to a vlaue from a bound control on your form

you need to replace MyTextControl with the name of your control of course

in both cases this code would be placed in the on open event of the form

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top