Skip to main content

Variable in IDEA editor

Hey, guys, I tried many things and didnt find the answer.
My problem is that I want to get a value from an InputDialog and assign it to a variable: so far so good.
Now I want to use it in the equation editor. Unfortunately, I cant sort out the double quotion marks in a right way.
This is the code that I'd like having to work:
 
0) this is the inputbox:
Dim eingabe As String
eingabe = InputBox("Bitte geben Sie hier das Rückrechnungsdatum ein", "Rückrechnung", "")
MsgBox "Datum zur Rückrechnung: " & eingabe
-------------------------------------------------------
1) the code of a normal extraction with a typed string value:
Set db = Client.OpenDatabase("Datumsabweichungen Beleg- und Buchungsdatum.IMD")
Set task = db.Extraction
task.IncludeAllFields
dbName = "EXTRAKTION1.IMD"
task.AddExtraction dbName, "", "BLDAT >= ""20200101"""
task.CreateVirtualDatabase = False
task.PerformTask 1, db.Count
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
-------------------------------------------------------
2) the code with the variable in the equation:
I just need this variable to be in there:
Set db = Client.OpenDatabase("Datumsabweichungen Beleg- und Buchungsdatum.IMD")
Set task = db.Extraction
task.IncludeAllFields
dbName = "EXTRAKTION2.IMD"
task.AddExtraction dbName, "", "BLDAT >= " &"""& eingabe & """
task.CreateVirtualDatabase = False
task.PerformTask 1, db.Count
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
 
Thanks in advance and much appreciated!

Brian Element Fri, 02/19/2021 - 09:35

This should work:

"BLDAT >= """ & eingabe & """"

another way to write it is the following using the chr(34) which is the "

"BLDAT >= " & Chr(34) & eingabe & Chr(34)

janwaj Mon, 02/22/2021 - 06:17

"BLDAT >= " & Chr(34) & eingabe & Chr(34)    works like a charm!
 
Thank you very much!!
 

The website encountered an unexpected error. Try again later.