Using TempVars with Login form
I have been looking at the Northwind example database and would like to use the login dialog screen as the base login for my application.
I would like to add a password for the user to log on with. I have managed to get the process of the enter of the user name and then a password to work using VBA but where I am having a problem is then to set a temp variable with the users name that I can pass on to other forms.
In the example the login dialog uses a macro and settempvar which works prefectly. I have not been able to set this up in a macro (as in the example) so I have built the login in vba and all works except setting the temp variable to pass on. With the example you set the temp variable in the macro and then a default value on the property sheet of each screen as =[TempVars]![CurrentUserID] but when I try this with my VBA code it catches that last entry I made (the password) and uses that.
i am sure that it is very simple but I just cant get my mind around the solution.
Any suggestions please
Gary
I have been looking at the Northwind example database and would like to use the login dialog screen as the base login for my application.
I would like to add a password for the user to log on with. I have managed to get the process of the enter of the user name and then a password to work using VBA but where I am having a problem is then to set a temp variable with the users name that I can pass on to other forms.
In the example the login dialog uses a macro and settempvar which works prefectly. I have not been able to set this up in a macro (as in the example) so I have built the login in vba and all works except setting the temp variable to pass on. With the example you set the temp variable in the macro and then a default value on the property sheet of each screen as =[TempVars]![CurrentUserID] but when I try this with my VBA code it catches that last entry I made (the password) and uses that.
i am sure that it is very simple but I just cant get my mind around the solution.
Any suggestions please
Gary
Last edited: