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!
janwaj
Offline
Last seen: 2 years 12 months ago
Joined: 02/19/2021 - 08:39
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)
"BLDAT >= " & Chr(34) & eingabe & Chr(34) works like a charm!
Thank you very much!!
That is good to hear, thanks for sharing.