Records not appearing in list box

cstanley

Registered User.
Local time
Today, 13:22
Joined
May 20, 2002
Messages
86
Hello all,

I have written a query which takes values from two tables:

tblPIDjoin: Index, PIDNumber, SystemNumber

tblPID: PIDNumber, DrawingTitle

The query takes the SystemNumber and PIDnumber fields from the one table and the DrawingTitle field from the other table. I then have as the criteria for the SystemNumber field that it pull a value from a text box on a form, thus pulling only the records I am interested in. I've then set the OnChange property of the text box to update the RowSource of a list box, using the following code:

stDocName = "qryPIDmain"
Me.[lstDrawing].RowSource = "qryPIDmain"


But, the list box is not updating... it just shows a blank. What am I doing wrong?

Thanks,

Chris
 
I believe you need to add:
Me.Refresh

This should refresh the form
 
Actually - that didn't work. But - I found out it works when I run the code on the "On Focus" rather than "On Change" property... why is that?
 
Ya know, the OnChange event runs for each and every character that gets entered into the control. So, if you type in 'feet', it would run 4 times. You might actually have better luck using the LostFocus event for the TextBox instead of the OnFocus event of the ListBox
 

Users who are viewing this thread

Back
Top Bottom