two txt field owrking either way on change event

mel9338

New member
Local time
Today, 15:47
Joined
Aug 18, 2004
Messages
6
hi guys.. would like to ask this question...hope anyone can help me
previously, i was able to make a unbound "listbox" that retrieve all record from a single table then it's filter out based on an unbound "txtbox" [on change event procefure] where user type in and the "listbox" data is filter depend on what user enter in the "txtbox".

Now come my problem.. i need to make two txtbox now that also based on [on change event procedure]. user can either use one of the txtbox to filter out or using both to get a more precise record..my question now is that how can i achieve that? based on the vba that i get workin based on one txtbox.. is it the same as making another [on change event procedure] txtbox with the same coding i done with the first txtbox?

i have try to make identical vba coding for the second txtbox.. it does function but sadly when user type in the new unbound txtbox.. somehow the field it suppose to filter dissapear in the listbox.i have done checking on all the column thing..it will filter for me but the field just dissapear.. anyone know y is that happening to me?

thanks in advance :)
 
From your OnChange event on either of the text boxes, call a function so that you are only using the code once.

It is a bit hard to advise without knowing how you are doing the filtering, but basically your Select criteria in the function would perform like...

"SELECT fld... From tblName WHERE fld1 = " & Me.txt1 & " AND fld2 = " & Me.txt2

If you are still having problems then either post the db or paste the code on your next post.

Peter
 

Users who are viewing this thread

Back
Top Bottom