Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Please be gentle, I'm still new to QlikView, learning quite rapidly though!
I am trying to use a Macro to insert SQL data from a sheet, most of the data I've figured out for myself but I have no idea how to access the Slider value, which will be inserted into a SQL table.
The code I have already (not working...) is
Sub InsertSQL
SET Prod = ActiveDocument.Fields("Rework Name")
SET ProdX = Prod.GetSelectedValues
SET Name = ActiveDocument.Fields("RailCir Name")
SET NameX = Name.GetSelectedValues
Num = getVariable("Number")
Dim sql,conn
Set conn = CreateObject("ADODB.Connection")
Conn.Open "Provider=SQLOLEDB.1;Data Source=SQL;Initial Catalog=MyDatabase","user","password"
sql = "INSERT INTO Rework ([Product],[Name],[Date],[Number]) VALUES ('" & ProdX(0).Text & "','" & NameX(0).Text & "','" & Num & "',GETDATE())"
'conn.execute(sql)
msgbox(sql)
End Sub
As you can see, I've referenced the two List Boxes and pulled the relative information out but I've no idea how to do it for the Slider.
Hi Jason,
try using
set MyVar = ActiveDocument.Variables("Number")
Num =MyVar.GetContent.String
instead of
Num = getVariable("Number")
Let me know
Best regards
Andrea
Hi Jason,
try using
set MyVar = ActiveDocument.Variables("Number")
Num =MyVar.GetContent.String
instead of
Num = getVariable("Number")
Let me know
Best regards
Andrea
Thank you so much! That worked perfectly, I do usually code in VBScript but QlikView has some odd ways of referencing these things.