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.

Empfohlene Antworten

Veröffentlicht

Hallo Leute

Bin schon beinahe am Verzweifeln. Ich bin absoluter Laie in VBA und komme nicht weiter. Ich hoffe ich finde hier eine helfende Hand.

Ich versuche eine Datenbank in Acceess zu basteln. Dabei verwende ich für gewisse Rechnungen gerne VBA

Ich arbeite mit 3 Feldern:

1. Feld (modemTyp)

Hier stehen folgende Inhalte zur Auswahl: Motorola, THG520, THG540, THG570 und EPC3212

2. Feld (cmMAC)

In dieses Feld wird vom User die 12stellige, hexidezimale Modem-MAC-Adresse eingetragen.

3. Feld (mtaMAC)

Dieses Feld soll nun automatisch beim verlassen von cmMAC errechnet werden.

Die Rechnung soll nach den Kriterien in modemTyp wie folgt aussehen:

Bei Motorola soll das Feld leer bleiben

Bei den THG* soll +1 zur cmMAC gerechnet werden

Bei EPC soll +2 zur cmMAC gerechnet werden

Was ich bis jetzt habe:

Private Sub cmMAC_Exit(Cancel As Integer)

If ModemTyp = "Motorola" Then mtaMAC = ""

If ModemTyp = "THG520" Then mtaMAC = mtaMAC + &H1

If ModemTyp = "THG540" Then mtaMAC = mtaMAC + &H1

If ModemTyp = "THG570" Then mtaMAC = mtaMAC + &H1

If ModemTyp = "EPC3212" Then mtaMAC = mtaMAC + &H2

End Sub

Für eure Hilfe danke ich euch jetzt schon tausendmal.

Gruss Lupo vor dem umfallen

Bearbeitet von Lupo79

was ist jetzt deine Frage?

Ich erhalte nun den Laufzeitfehler '13' Typen unverträglich.

Wie verklickere ich VBA, dass mein Feld "mtaMAC" bereits Hex ist?

Bearbeitet von Lupo79

Mit

mtaMAC = mtaMAC + &H2
beziehst du dich implizit auf mtaMAC.Text als Defaultproperty des Textfeldes, welches ein String ist und da du versuchst, eine Zahl auf einen String zu addieren, fliegt der Fehler 13. Dh. du mußt hier zum Addieren eine explizite Typumwandlung (CLng, CStr) vornehmen.

Gruß Martin

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.