|
tech
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Buttons and ListboxesHow do you set up a listbox that is filled by pressing a command button.
I have two buttons, if you press button 1, I want the listbox to fill with certain info, press button 2, it would fill with other info. The listbox would be based on a query. Thnak You DS Using the OnClick event of each button, set the RowSource for the ListBox to
the individual SQL string you need. YourListBox.RowSource = "SELECT DISTINCTROW tblYourTable.... etc... etc... " hth Al Camp Show quote "DS" <booty***@optonline.net> wrote in message news:WA2Td.2666$qY2.377@fe09.lga... > How do you set up a listbox that is filled by pressing a command button. > I have two buttons, if you press button 1, I want the listbox to fill with > certain info, press button 2, it would fill with other info. The listbox > would be based on a query. > Thnak You > DS AlCamp wrote:
Show quote > Using the OnClick event of each button, set the RowSource for the ListBox to > the individual SQL string you need. > > YourListBox.RowSource = "SELECT DISTINCTROW tblYourTable.... etc... etc... " > > hth > Al Camp > > "DS" <booty***@optonline.net> wrote in message > news:WA2Td.2666$qY2.377@fe09.lga... > >>How do you set up a listbox that is filled by pressing a command button. >>I have two buttons, if you press button 1, I want the listbox to fill with >>certain info, press button 2, it would fill with other info. The listbox >>would be based on a query. >>Thnak You >>DS > > > Thank You! DS Use Qry1 for case 1 and Qry2 for case 2. Put this code in the click event of
button 1: Me!NameOfListbox.Rowsource = "Qry1" Put this code in the click event of button 2: Me!NameOfListbox.Rowsource = "Qry2" -- Show quotePC Datasheet Your Resource For Help With Access, Excel And Word Applications resou***@pcdatasheet.com www.pcdatasheet.com "DS" <booty***@optonline.net> wrote in message news:WA2Td.2666$qY2.377@fe09.lga... > How do you set up a listbox that is filled by pressing a command button. > I have two buttons, if you press button 1, I want the listbox to fill > with certain info, press button 2, it would fill with other info. The > listbox would be based on a query. > Thnak You > DS PC Datasheet wrote:
Show quote > Use Qry1 for case 1 and Qry2 for case 2. Put this code in the click event of Great Thank You, running off to do it now!> button 1: > Me!NameOfListbox.Rowsource = "Qry1" > Put this code in the click event of button 2: > Me!NameOfListbox.Rowsource = "Qry2" > > -- > PC Datasheet > Your Resource For Help With Access, Excel And Word Applications > resou***@pcdatasheet.com > www.pcdatasheet.com > > > "DS" <booty***@optonline.net> wrote in message > news:WA2Td.2666$qY2.377@fe09.lga... > >>How do you set up a listbox that is filled by pressing a command button. >>I have two buttons, if you press button 1, I want the listbox to fill >>with certain info, press button 2, it would fill with other info. The >>listbox would be based on a query. >>Thnak You >>DS > > > DS |
|||||||||||||||||||||||