1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
Modul
public base as database
public E_client as recordset
public Ouverture()
set base=opendatabase(app.path & "\Gestion Client)" 'Ouverture de la bdd'
set E_client=base.openrecordset("Client") 'ouverture de la table'
End sub
Private sub Form_load()
Ouverture
form1.keypreview=1 'Activer Le keypress Touche entrer'
End sub
Private sub Text1_lostfocus()
with E_client 'La table Client'
if text1<>"" then
.index="Client.ndx" 'Le nom de l'index '
.seek"=",text1
if not .nomatch then 'si j'l'ai trouver?'
text2=!Nom 'affiche moi le Nom client'
text3=!adr 'Afiiche Moi l'adresse'
endif
end with
end if
End sub
Private sub form_keypress() 'pour activer la touche entrer'
if keyascii=13 and text1<>"" then text2.setfocus
if keyascii=13 and text2<>"" then text3.set focus
End sub |
Partager