Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I want to set three variables uid, username and pwd in my qv document.
User click on a button, then a macro is called and asks for User name and password.
When user enters these two things, then macro should extract uid from database table and set the document level variables.
How can i do this ?
Thanks in advance
There are a few different things you will need to do to implement this functionality. I would probably load the uid data in when all other data is loaded into the document. Then you don't have to worry about a partial reload when the macro runs.
You can set up a macro to run when the user clicks the button. In VB Script, you can use an Input Box [inputbox()] to get user input. The user input will be returned within the macro and you can use those values to populate QlikView variables. Here is a simple example:
Sub GetUserName
userNm = inputBox("Input your username")
ActiveDocument.Variables("vUserName").SetContent userNm, true
End Sub
Then, if you have your user data loaded, you probably want to select the appropriate uid based on the inputs and the data. The method you would use here would depend on how your data is set up.
There are a few different things you will need to do to implement this functionality. I would probably load the uid data in when all other data is loaded into the document. Then you don't have to worry about a partial reload when the macro runs.
You can set up a macro to run when the user clicks the button. In VB Script, you can use an Input Box [inputbox()] to get user input. The user input will be returned within the macro and you can use those values to populate QlikView variables. Here is a simple example:
Sub GetUserName
userNm = inputBox("Input your username")
ActiveDocument.Variables("vUserName").SetContent userNm, true
End Sub
Then, if you have your user data loaded, you probably want to select the appropriate uid based on the inputs and the data. The method you would use here would depend on how your data is set up.
Thanks bro,
It worked for me.