KeyPressed Event

Markvand

Registered User.
Local time
Today, 12:50
Joined
Jul 13, 2004
Messages
88
Hi all,

I have main form "frm_Haupt_Material" with text field and I am using it as some kind of
a search box. I have a querry based on this field which looks like this:

SELECT Lagerbestand.Indeks, Lagerbestand.Nazwa, Lagerbestand.JM, Lagerbestand.MAG, Lagerbestand.Bestand
FROM Lagerbestand
WHERE (((InStr([Indeks],[Forms]![frm_Haupt_Material]![Such_Dat]))>0))
WITH OWNERACCESS OPTION;

The results are listed in a subform "frm_inq_Daten_suchen!indeks ",

The problem is that, I want to have the results when user types in a part of the index and presses the "Enter". That's why I was thinking about Keypressed event. I have the following code but it doesn't work

Private Sub Such_Dat_KeyPress(KeyAscii As Integer)

Dim suchdat As Control

Set suchdat = Forms!frm_inq_Daten_suchen!indeks

If (KeyAscii = vbKeyReturn) Then

suchdat.Requery

End If
End Sub

Is there a better way to do this?

Any help would be great

Mark
 

Users who are viewing this thread

Back
Top Bottom