ich habe in meiner ACCESS-Datenbank ca. 20 Formulare erstellt. Jetzt haben wir uns für ein anderes Design entschieden, andere Farben, Spezialeffekte, etc. Ich habe VBA-Code geschrieben und den in das BeimKlick-Ereignis einer neuen Befehlsschaltfläche gepackt:
- Code: Alles auswählen
Private Sub Form_Open(Cancel As Integer)
Dim ctl As Control
Me.Detailbereich.BackColor = RGB(247, 249, 255)
Me.Formularfuß.BackColor = RGB(247, 249, 255)
Me.Formularkopf.BackColor = RGB(247, 249, 255)
For Each ctl In Me.Form.Controls
Select Case ctl.ControlType
Case acTextBox, acComboBox, acListBox
ctl.ForeColor = RGB(20, 63, 105)
ctl.BorderColor = RGB(20, 63, 105)
ctl.SpecialEffect = 2
Case acLabel
ctl.ForeColor = RGB(20, 63, 105)
ctl.BackStyle = 0
Case acRectangle
ctl.BackColor = RGB(175, 207, 239)
Case acCommandButton
ctl.BackColor = RGB(20, 63, 105)
ctl.BorderColor = RGB(255, 255, 255)
ctl.ForeColor = RGB(255, 255, 255)
ctl.UseTheme = True
ctl.PressedColor = RGB(52, 119, 178)
ctl.PressedForeColor = RGB(64, 64, 64)
ctl.HoverColor = RGB(192, 216, 237)
ctl.HoverForeColor = RGB(64, 64, 64)
End Select
Next ctl
Set ctl = Nothing
End Sub
Das funktioniert auch, ändert den Entwurf aber nur temporär. Als Notlösung habe ich es in jedem Formular in BeimÖffnen getan, der Benutzer merkt den Unterschied nicht aber optimal ist es natürlich nicht. Ich habe mit einer Internetrecherche keine Lösung finden können. Für Hilfe wäre ich sehr dankbar, möglichst einfach formuliert.

Ich bin kein großer VBA-Experte, das hier ist schon eine Leistung, auf die ich etwas stolz bin.
Andreas