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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't seem to refresh a listbox

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I run the following to print a report. I can't get the requery to work. After I preview a report I choose a different report number in the lstRef list box but when I stop the code on this second print job the item selected is still the first one not the new selection. After the first preview, every preview regardless of which reference number I choose I only get a preview of the first reference number I chose.
How can I refresh the listbox so the new selection is chosen?
Thanks

strRef = Forms!frmPrint!lstRef.ItemData(itm)
Me!txtRef.Value = strRef
'Run Report
cmdMainMenu.SetFocus
lstRef.Requery

 
how are ya EddyLLC . . .

Requery doesn't work for listbox. Havn't found a reason why yet but it doesn't.
Code:
[blue]   Me!lstRef.RowSource = Me!lstRef.RowSource[/blue]
The above does work! [thumbsup2] [blue]Any time you change the rowsource of a listbox it automatically requires![/blue] . . . same is for combobox . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top