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.

Reihenfolge in einer Controlsauflistung ändern

Empfohlene Antworten

Veröffentlicht

Hallo zusammen

diesmal hab ich nen Prob, wo ich nicht weiß, ob es dafür wirklich ne Lösung gibt. Mein Problem:

Ich habe ein Frame mit verschiedenen Elementen (Label, Picture, Textbox und CommandButton).

Dieses Auflistung möchte ich nun durchlaufen und jedem dieser Elemente etwas aus der Datenbank zuweisen (außer den Buttons)

Es gibt also immer ein zusammengehöriges Set bestehend aus ImageBox, Label und TextBox

Wenn ich nun die Controls durchlaufe ist leider die Reihenfolge leider nicht "sortiert" (siehe unten).

Wie kann ich nun erreichen, dass die Controls in einer benutzerdefinierten Reihenfolge abgefragt (durchlaufen) werden?

Ich habe mir die Reihenfolge mal im Direktfenster ausgegeben. Danach habe ich gedacht, ich könnte es mit dem Tabulator ändern, habe jedem Element einen neuen TabIndex gegeben, leider jedoch ohne Änderung der Ausgabe.

Gibt es einen Weg, die Reihenfolge so zu ändern, dass wenn ich die Controls durchlaufe, ich bei

lblFoto1 anfange, über imgFoto1 zum txtFoto1Bem komme. Wann die Button kommen ist mir schnurz, die werden eh rausgefiltert beim füllen.

Der Erfolg soll sein, dass ich nicht bei jedem Control.Element den Courser in der Datenbank neu positionieren muß, sondern erst nach dem eintrag der 3 relevanten Daten.

Im zweitem Fenster ist der Code aus meinem Projekt

For Each Element In userform1.frameFotos.Controls() : ? element.name : next

lblFoto1

imgFoto1

cmdFotoVor

cmdFotoZurück

cmdNeuFoto

imgFoto2

imgFoto3

imgFoto4

imgFoto5

imgFoto6

lblFoto5

lblFoto3

lblFoto4

lblFoto6

lblFoto2

txtFoto1Bem

txtFoto2Bem

txtFoto3Bem

txtFoto4Bem

txtFoto5Bem

txtFoto6Bem

Private Sub BilderZuweisen()

Dim i As Integer

Dim Label As String

Dim Element As Object

  frameFotos.Visible = False

  For Each Element In frameFotos.Controls

    If Left$(Element.Name, 3) = "img" Then

      If Not rstFotos.EOF And Not rstFotos.BOF Then

        Element.Picture = LoadPicture(CurrentProject.Path & "\Bilder\" & rstFotos!LinkAdr)

        rstFotos.MoveNext

      Else

        Element.Picture = LoadPicture("")

      End If

    ElseIf Left$(Element.Name, 3) = "lbl" Then

      If Not rstFotos.EOF And Not rstFotos.BOF Then

        Element.Caption = rstFotos!Bemerkung

        rstFotos.MoveNext

      End If

    End If

  Next

' Datensatzsteuerung einstellen

  If rstFotos.AbsolutePosition > 5 And rstFotos.AbsolutePosition < rstFotos.RecordCount Or rstFotos.BOF Then

    cmdFotoVor.Enabled = True

  Else

    cmdFotoVor.Enabled = False

  End If

  If rstFotos.AbsolutePosition > 6 Or rstFotos.EOF Then

    cmdFotoZurück.Enabled = True

  Else

    cmdFotoZurück.Enabled = False

  End If

  frameFotos.Visible = True


End Sub

lblFoto1

imgFoto1

txtFoto1Bem

lblFoto2

imgFoto2

txtFoto2Bem

lblFoto3

imgFoto3

txtFoto3Bem

lblFoto4

imgFoto4

txtFoto4Bem

lblFoto5

imgFoto5

txtFoto5Bem

lblFoto6

imgFoto6

txtFoto6Bem

edith sagt:

Access Version 2000 (Vers 9 ) mit ExcelForms (also nicht die "StandartForms" aus Access)

Bearbeitet von PromiseYou
Accessversion vergessen

Hab ne Lösung gefunden.

Habe jeweils die drei Steuerelemente (txt, lbl und img) als Gruppe zusammengefasst und dann via Tag einzeln durchnummerriert.

Nun fange ich den Tag ab und positioniere entsprechend den Cursor im Recordset.

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.