Variable in IDEA editor

4 posts / 0 new
Last post
janwaj
Offline
Joined: 02/19/2021 - 08:39
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 02/19/2021 - 08:39

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

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

That is good to hear, thanks for sharing.