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

List Box in header section of form

Status
Not open for further replies.

ineedahelp

Technical User
Mar 31, 2009
27
US
I have a form (frmMainData) with a combo box (comboFindClient)and a subform (subfrmPayment) with a multi select list box in the header. The SQL for the recordset of the list box is as follows:
Code:
SELECT JobInfo.JobID, JobInfo.JobDate, JobInfo.JobDescription, JobInfo.BilledOn, JobInfo.Paid, [HoursWorked]*[JobRate] AS Cost
FROM JobInfo
WHERE (((JobInfo.Paid)=False) AND ((JobInfo.ClientID)=[forms]![frmMainData]![comboFindClient]))
ORDER BY JobInfo.JobDate DESC;
If I put an actual number as the criteria instead of Forms!frmMainData!comboFindClient my listbox populates...otherwise nothing.

Any help?
 
How are ya ineedahelp . . .

When you make a selection from the combobox, you need to requery the listbox.

In the [blue]After Update[/blue] event of [blue]comboFindClient[/blue] try:
Code:
[blue]   Dim ctl As Control
   
   Set ctl = Forms!frmMainData!subfrmFindClient.Form![purple][B][I]ListboxName[/I][/B][/purple]
   ctl.RowSource = ctl.RowSource
   Set ctl = Nothing[/blue]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
You are the AceMan...thanks...works like a charm and makes sense too!
 
ineedahelp . . .

Glad it worked.

BTW: Welcome to [blue]Tek-Tips![/blue] [thumbsup2] Do have a look at one of the links at the bottom of my post. The links will help you [blue]ask better questions[/blue], get [blue]quick responses[/blue], [blue]better answers[/blue], and insite into [blue]etiquette[/blue] here in the forums. Again . . . Welcome to [blue]Tek-Tips![/blue] [thumbsup2] [blue]Its Worthy Reading![/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top