FindAsUType on read only query

  • Thread starter Thread starter exebat
  • Start date Start date
E

exebat

I used this great module for long time on tables, but now I have a
form whose record source is read only query and all works fine while I
type values that exist in the query, but if data is not there I get
empty filtered form that wont turn off filtering no mater what I try.

What can I do to get this to work like it does for tables ?
 
You should not be working in tables. Even the most experienced Oracle and
SQL-Server professionals do not work in tables. Why Microsoft seems to
encourage it is beyond my comprehension. It is easy to do, but it is also
really easy to destroy a lot of data.

That said, if you create a form with an unbound combo box, or list box, you
can use that control to find the first record, or as a filter for all of
them. Base a query on the data in your form and change the recordsource in
the combo box's AfterUpdate event, or just use the query as the form's
recordsource, and requery it in the AfterUpdate even.
 
I am not working in tables directly - I am using form that has table
as record source. I forgot to mention.

I would like to filter form on key down event.
That said, if you create a form with an unbound combo box, or list box, you
can use that control to find the first record, or as a filter for all of
them. Base a query on the data in your form and change the recordsource in
the combo box's AfterUpdate event, or just use the query as the form's
recordsource, and requery it in the AfterUpdate even.

Already did that, but filtering seems to be faster then changing
record source and requerying every time user presses the key.

Allens module works very well on form if record source is table, but
if it its source is a read-only query, it doesnt work. (It also wont
work if form Allow Additions is set to False)

I used the temporary solution to copy the query data to dummy table,
but it takes too much time as it is run every time the form is opened.

Any suggestions ?
 
exebat said:
I am not working in tables directly - I am using form that has table
as record source. I forgot to mention.

I would like to filter form on key down event.


Already did that, but filtering seems to be faster then changing
record source and requerying every time user presses the key.

A filter is a query, and if saved as a query, is actually faster than being
created on the fly. It is inefficient to filter on every keystroke. I
generally do it in code and type several keystrokes before starting the
filter process. Instead of using the keydown event, try using the Change
event, then ignoring the first few keystrokes, like (aircode):

Sub txtMyText_Change()
If Len(Me.txtMyText) >3 Then
'Run your filter query
End Sub
 
A filter is a query, and if saved as a query, is actually faster than being
created on the fly. It is inefficient to filter on every keystroke. I
generally do it in code and type several keystrokes before starting the
filter process. Instead of using the keydown event, try using the Change
event, then ignoring the first few keystrokes, like (aircode):

Sub txtMyText_Change()
š š If Len(Me.txtMyText) >3 Then
š š š š 'Run your filter query
End Sub

Did it, and it works great.

Tnx a lot Arvin.
 
"exebat" <[email protected]> a ecrit dans le message de
A filter is a query, and if saved as a query, is actually faster than
being
created on the fly. It is inefficient to filter on every keystroke. I
generally do it in code and type several keystrokes before starting the
filter process. Instead of using the keydown event, try using the Change
event, then ignoring the first few keystrokes, like (aircode):

Sub txtMyText_Change()
If Len(Me.txtMyText) >3 Then
'Run your filter query
End Sub

Did it, and it works great.

Tnx a lot Arvin.
 
Back
Top