Zum Inhalt springen

Empfohlene Beiträge

Geschrieben

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

Geschrieben

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...

Geschrieben

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?

Geschrieben

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.

Erstelle ein Benutzerkonto oder melde Dich an, um zu kommentieren

Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde Dich hier an.

Jetzt anmelden

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...