lisbox problem with null values from sql statement help?

Manos39

Registered User.
Local time
Today, 05:53
Joined
Feb 14, 2011
Messages
248
I am using a lisbox in a form to show results depending on unbound textboxes. These textboxes function with on change event procedure

Private Sub txtAM_Change()

Me.txtAMX = Me.txtAM.Text
Me.Listsearch.Requery
End Sub

When form runs it shows 131 records on listbox. When I type on an unbound textbox to show up values from a field the sql statement uses and that has null values the listbox will not populate correctly (showing less records from then on)
Tried with the criteria in the sql statement:

[ΑΜ] Like [txtΑΜX] & "*" Or [txtΑΜX] Is Null

But still problem insists



Maybe code to manipulate null? I need help please
 
The above will return any record that starts with the value currently held by [txtΑΜX] or that Is Null
 
John thank you, seems that works but the reason i keep stucking is.... that when the form starts the listbox inside is poplated by 131 records. After changing a value in texboxes lisbox is refering to, it should be populated in less records i agree. When erasing the values shoudnt all return to 131 records? yes i think. In my form there are 8 textboxes, 5 of them when have null value return 131 records. Three of them when changed and on manage to populate my listbox with much lesser records. Is there something to do with event prosedures? I have one procedure on change
Private Sub txtAM_Change()

Me.txtAMX = Me.txtAM.Text
Me.Listsearch.Requery
End Sub

Is there a need to have a second procedure to command listbox to be populated by al previus records that were there like when form was run, since again no value is in the textboxes?
Thank you for your replye.
 

Users who are viewing this thread

Back
Top Bottom