Skip to main content

AccessTr.neT


Metin Kutularında Otomatik Tamamlama

Metin Kutularında Otomatik Tamamlama

#30
If GetAsyncKeyState hatası veriyor
Option Explicit
#If VBA7 And Win64 Then
Private Declare PtrSafe Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
#Else
Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
#End If





Option Compare Database
'Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Function otomotiktamamla(kutuadi As String)
Dim ctl As Control
Dim LenOldText As Long
Static Once As Boolean
Dim rst As Object
If Once = False Then
If GetAsyncKeyState(vbKeyBack) = 0 _
And GetAsyncKeyState(vbKeyDelete) = 0 Then
Once = True
On Error Resume Next
Set ctl = Screen.ActiveForm.ActiveControl
Set rst = Screen.ActiveForm.RecordsetClone
If ctl.Text <> "" Then
rst.FindFirst kutuadi & " LIKE '" & ctl.Text & "*'"
If Not rst.NoMatch Then
LenOldText = Len(ctl.Text)
ctl.Text = rst(kutuadi)
ctl.SelStart = LenOldText
ctl.SelLength = Len(ctl.Text) - LenOldText
End If
End If
Set ctl = Nothing
Set rst = Nothing
On Error GoTo 0
Once = False
End If
End If
End Function
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Metin Kutularında Otomatik Tamamlama - Yazar: BARİSY - 31/01/2013, 15:36
Task