Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

kleines Prob in VBA

Empfohlene Antworten

Veröffentlicht

Hi Leute

ich hab hier ein kleines Problem in Microsoft Word. Mir gefallen die einträge Artikel.hide und Artikel.show nicht (Fett)

Wie könnte ich diese schreibvariante ändern

Private Sub CommandButton1_Click()

If TextBox1 > "" Then

If CheckBox1 = True And CheckBox2 = True Then

MsgBox "Bitte kreuzen Sie nur ein Feld an"

Artikel.hide

Artikel.show

Else

If CheckBox1 = False And CheckBox2 = False Then

MsgBox "Bitte kreuzen Sie ein Feld an"

Artikel.hide

Artikel.show

Else

If CheckBox1 = True Then

ActiveDocument.Bookmarks("Kontrollkästchen1").Select

Selection.TypeText Text:="X"

Else

ActiveDocument.Bookmarks("Kontrollkästchen2").Select

Selection.TypeText Text:="X"

End If

End If

End If

End If

If CheckBox1 = True And CheckBox2 = False Or CheckBox1 = False And CheckBox2 = True Then

ActiveDocument.Bookmarks("Text1").Select

Selection.TypeText Text:=TextBox1.Value

ActiveDocument.Bookmarks("Text2").Select

Selection.TypeText Text:=TextBox2.Value

ActiveDocument.Bookmarks("Text3").Select

Selection.TypeText Text:=TextBox3.Value

ActiveDocument.Bookmarks("Text4").Select

Selection.TypeText Text:=TextBox4.Value

ActiveDocument.Bookmarks("Text5").Select

Selection.TypeText Text:=TextBox5.Value

ActiveDocument.Bookmarks("Text6").Select

Selection.TypeText Text:=TextBox6.Value

ActiveDocument.Bookmarks("Text7").Select

Selection.TypeText Text:=TextBox7.Value

ActiveDocument.Bookmarks("Text8").Select

Selection.TypeText Text:=TextBox8.Value

ActiveDocument.Bookmarks("Text9").Select

Selection.TypeText Text:=TextBox9.Value

ActiveDocument.Bookmarks("Text10").Select

Selection.TypeText Text:=TextBox10.Value

Fertig.Show

Artikel.hide

End If

Was willst du denn damit bezwecken dass du die ein und die selbe Form mal auf, mal zu machst? :confused:

Wenn kein anderes Fenster gleichzeitig angewählt werden soll (z.B. duch Alt+Tab) dann musst du Form.show vbModal

Eingeben.

Ansonsten musst du mal näher erklären, was du machen willst...

Ich will quasi das wenn die eine Fehlermeldung kommt, das man die dann wegdrückt und das dann nochmal das Formular erscheint um es zu verbessern.

Wie meinst du das mit dem vbModal

meinst du dann artikel.show vbModal oder wie?

Eine Fehlermeldung legt sich automatisch über das Formular, und das Formular bleibt eigentlich im Hintergrund, sofern du nicht unload.me oder form.hide sagst. Von daher brauchst du das mit dem hide und show gar nicht.

Probiers einfach mal an einem Leeren Formular aus.

Private Sub Form_Load()

msgbox "Hallo"

End Sub

Die Form bleibt stehen und die msgbox wird darübergelegt, bis du sie Wegklickst.

Ich bekomme das aber irgendwie nicht hin weil das ganze in einer Schleife ist und er dann einfach weiterhüpft. :(

Beschreib dein Problem mal genauer. Ich glaube, wenn wir dein Problem verstehen, können wir dir schneller un besser helfen.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.