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.

Variablen in Tabelle übergeben

Empfohlene Antworten

Veröffentlicht

Hallo, ich habe (wieder mal) folgendes Problem:

Ich habe eine Tabelle "TAB1" mit den Spalte A,B,C.

Dann habe ich eine VBA-Code. Zur Laufzeit werden die Variablen

Betrag1 und Betrag2 gefüllt, z.B. Betrag1=23, Betrag2=100.

Zusätzlich wird ein Text erzeugt:

DIM Text1 AS Variant

Text1="Hallo"

So, nun will ich alles in die TAB2 spielen:

SELECT * FROM TAB1, (Betrag1+Betrag2) AS GesamtSumme , Text1 AS GesamtText INTO TAB2;

Er spielt nun alle Datensätze rüber (die Tabelle wird durch den SELECT INTO neu erzeugt

und dann gefüllt). Er erzeugt ein neues Feld GesamtSumme mit der Summe aus Betrag1+Betrag2.

Soweit so gut. Nur leider erzeugt er kein Feld mit Text1. Anstatt dessen kommt eine

Box mit "Parameter eingeben:". Wenn ich hier was eingeben wird das korrekt als "GesamtText" übernommen.

Ich will aber das er die Variable Text1 hierzu nimmt.

Erstmal würde ich Text1 als String deklarieren und nicht als Variant. Spart Ressourcen... und behebt vielleicht auch den Fehler.

Gruß

JayN

hi,

Originally posted by Ischte

SELECT * FROM TAB1, (Betrag1+Betrag2) AS GesamtSumme , Text1 AS GesamtText INTO TAB2;

ist das dein sql-statement?

kann es sein, dass in tab1 die spalten betrag1 und betrag2 existieren?

wenn ja, wuerde ich es mal so versuchen:

SELECT * FROM TAB1, (Betrag1+Betrag2) AS GesamtSumme , '" & Text1 & "' AS GesamtText INTO TAB2

also den wert der variablen text1 in das sql-statement einbauen.

hoffe, es hilft...

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.