Discussion Locked

Populating A List Box

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to polulate a list box based on user selection in a checkbox. The user selection will determine which of a series of look up tables will become available for input into textbox control.

Thanks for you assistence.

5 replies

by shanghai sam

I will write this from the perspective of Access97. If your using VB let me know and I'll send you the code for that. As for the check boxes I am assuming that only 1 value can be checked and your using an option group named opt1.

Sub PopulateLstBox()
Dim strSQL as String

Select Case opt1
Case 1
strSQL="Select * FROM Tbl_Data1"
Case 2
strSQL="Select * FROM Tbl_Data2"
Case 3
strSQL="Select * FROM Tbl_Data3"
End Select
lstBox.RowSource=strSQL
End Sub

Hope this helps.

Neal Martinelli

by roc180

The site dropped my connection. I posted the above answer if you need to contact me.

Neal Martinelli

This discussion is closed to new replies.