27/02/2020, 19:08
Metin Kutuları
27/02/2020, 23:04
zaferlacin
Kod:
Dim ctrl As Control
Dim a As String
a = ""
For Each ctrl In Me.Controls
' If ctrl.Tag = "bosmu" And IsNull(ctrl) Or Nz(ctrl, "") = "" Then
If ctrl.Tag = "bosmu" And IsNull(ctrl) Then
a = a & vbCrLf & " " & ctrl.Controls(0).Caption
End If
Next
If Not a = "" Then
MsgBox (" AŞAĞIDAKİ ALANLAR BOŞ BIRAKILMIŞ...." & vbCrLf & vbCrLf & a)
Else
End If
28/02/2020, 01:48
feraz
Kod:
Private Sub Komut62_Click()
Dim i As Byte
Dim a As String
Dim arr1, arr2
arr1 = Array("Adi", "Soyadi", "Kimlik", "il", "ilce", "Mahalle")
arr2 = Array("Metin1", "Metin2", "Metin3", "Metin72", "Metin74", "Metin71")
For i = LBound(arr2) To UBound(arr2)
If Me.Controls(arr2(i)) = "" Or IsNull(Me.Controls(arr2(i)) = "") Then
a = a & arr1(i) & vbNewLine
End If
Next
MsgBox "AÞAÐIDAKÝ ALANLAR BOÞ BIRAKILMIÞ...." & vbNewLine & "-----------------" & vbNewLine & a
Erase arr1
Erase arr2
End Sub
28/02/2020, 02:21
feraz
Yada her metşn kutusunun Tag ını yazarsanız alttaki kod ilede olur.
Kod:
Private Sub Komut62_Click()
Dim i As Integer
Dim a As String
Dim arr
arr = Array("Metin1", "Metin2", "Metin3", "Metin72", "Metin74", "Metin71")
For i = LBound(arr) To UBound(arr)
If Me.Controls(arr(i)) = "" Or IsNull(Me.Controls(arr(i)) = "") Then
a = a & Me.Controls(arr(i)).Tag & vbNewLine
End If
Next
MsgBox "AÞAÐIDAKÝ ALANLAR BOÞ BIRAKILMIÞ...." & vbNewLine & "-----------------" & vbNewLine & a
Erase arr
End Sub
28/02/2020, 02:28
feraz
Alttaki kod ilede olur.
Kod:
Private Sub Komut62_Click()
Dim ctrl As Control
Dim a As String
For Each ctrl In Me.Controls
If ctrl.ControlType = acTextBox Then
If ctrl = "" Or IsNull(ctrl) Then
a = a & ctrl.Tag & vbNewLine
End If
End If
Next
MsgBox "AÞAÐIDAKÝ ALANLAR BOÞ BIRAKILMIÞ...." & vbNewLine & "-----------------" & vbNewLine & a
End Sub
28/02/2020, 09:41
alicimri
Fonksiyonel sıra ile kontrol yapıp uyarı veren kod aşağıda.
Kod:
Private Sub Komut0_Click()
Dim txt As Control
For Each txt In Me.Controls
If txt.ControlType = 109 Then
If IsNull(txt.Value) Then
MsgBox txt.Name & " Boş."
txt.SetFocus
Exit For
End If
End If
Next
End Sub