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 not requerying properly

Status
Not open for further replies.

TanyaSealey

Programmer
Jul 17, 2002
10
0
0
GB
I've created a form which contains a subform of payments, a list box of unpaid invoices, and a list box of invoices allocated to payments in the subform.

I want to update the allocated invoices list box using the On Current Event in the subform. The list box is based on a SQL user-defined function with the argument PaymentID. At the moment the following code is in the subform:

Code:
Forms!frmPaymentDetails!lstAllocated.RowSource = "SELECT * FROM dbo.udfAllocatedInvoices(" & Me.txtPaymentID & ")"
Forms!frmPaymentDetails!lstAllocated.Requery

However the results do not appear in the list box - normally the first record appears but no other. However if I scroll down the rest of the records appear, or I can click on an empty space within the list box and select an 'invisible' record - I can even access the values via code. It therefore appears that my code works but the list box isn't showing the records properly.

I hope this makes sense. Has anyone else encounter and resolved a similar problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top