in meiner Userform habe ich 8 Textboxen, diese prüfe ich auf einen Wert!
Ich würde gern die Abfrage der Datenübernahme dazu haben, bekomme es aber ohne Eure Hilfe nicht hin.
Was muss ich machen, dass nicht für alle 8 Textboxen die Abfrage kommt, sondern nur einmal?!?!
Private Sub UserForm_Initialize()
Frame2.Visible = False
End Sub
Private Sub CommandButton1_Click()
Dim obj As Control, i%
For i = 1 To 8
Set obj = Me.Controls("TextBox" & i)
If obj "" Then
If MsgBox("Wollen Sie wirklich", vbYesNo) = vbYes Then
TextBox2 = TextBox1
TextBox4 = TextBox3
TextBox6 = TextBox5
TextBox8 = TextBox7
Frame2.Visible = True
Else
Frame2.Visible = True
End If
End If
Next i
End Sub
'###############Ach ich habe es schon einmal für Checkboxen hier im Forum erfragt und kam mit dieser Antwort weiter,
Private Sub CommandButton1_Click()
Dim i As Integer, blnAktiv As Boolean
For i = 1 To 4
blnAktiv = blnAktiv Or Me.Controls("Checkbox" & i).Value
If blnAktiv Then Exit For
Next
If blnAktiv Then Unload Me _
Else MsgBox "Keine Checkbox aktiviert !", , "Nööö"
End Sub
Leider kann ich es aber nicht auf meine Textboxen umstellenFür eure Hilfe vielen dank im voraus!
LG Lisa