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.

Unterschiedliches Verhalten von Access bei API aufrufen

Empfohlene Antworten

Veröffentlicht

Moin ihr Lieben,

ich stolpere gerade über ein höchst merkwürdiges Phänomen und wüsste gerne woran das liegt. Es geht um einen selbstgehäkelten Datepicker um das unsägliche Kalender-Control zu umgehen.

Ich habe in einer Access-2000-mdb ein Modul mit folgendem Inhalt:


Option Compare Database

Public DatePickerAntwort As Variant


Public Declare Function GetWindowLong Lib "user32" _

  Alias "GetWindowLongA" ( _

  ByVal hwnd As Long, _

  ByVal nIndex As Long) As Long


Public Declare Function SetWindowLong Lib "user32" _

  Alias "SetWindowLongA" ( _

  ByVal hwnd As Long, _

  ByVal nIndex As Long, _

  ByVal dwNewLong As Long) As Long


Public Const GWL_STYLE = (-16)

Public Const WS_CAPTION = &HC00000

Im Formular, das den Datepicker darstellt habe ich u.a. folgenden Code, der bei Aufruf des Formulars dessen Titelleiste ausschaltet.

Private Sub Form_Load()

    Dim nStyle As Long


    With Me

      ' aktuellen Fensterstil emitteln

      nStyle = GetWindowLong(.hwnd, GWL_STYLE)


      ' Titelleiste entfernen

      nStyle = nStyle And Not WS_CAPTION


      ' Neuen Fensterstil setzen

      SetWindowLong .hwnd, GWL_STYLE, nStyle

    End With

End Sub

Auf meinem Rechner funktioniert das alles einwandfrei, aber von 2 anderen Plätzen passiert folgendes: Öffnet man das Formular direkt aus dem Datenbankmenü ist alles in Ordnung, öffnet man es aber via Doppelklick auf ein Datumsfeld in einem anderen Formular wird die Titelleiste trotzdem angezeigt.

    If Me.ActiveControl.Enabled And Not Me.ActiveControl.Locked And Me.AllowEdits Then

        DoCmd.OpenForm "DatePicker", , , , , acDialog, Me.ActiveControl.Value

        If Not IsNull(DatePickerAntwort) Then

            Me.ActiveControl.Value = DatePickerAntwort

        End If

    End If

Hat einer eine Idee, was da schief läuft. Ich habe keinen wesentlichen Unterschied zwischen den Rechnern gefunden, die user32.dll ist bei allen identisch.

Hilfreiche Antworten werden wie immer mit reichlich Kaffee oä an Selbstabholer prämiert...

Verwirrte Grüße aus Osnabrück

Reinhold

Moin,

ich habe jetzt herausgefunden, wie man das Problem beheben kann, verstehe aber irgendwie nicht den Zusammenhang.

Wenn man in den Desktop-Eigenschaften unter Design "Windows XP" einstellt klappt alles bestens, stellt man hier aber "Windows klassisch" ein, tritt der beschrieben Fehler auf.

Ist das ein Bug oder ein Feature? :upps:upps

Reinhold

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.