Dim Function (1 Viewer)

MAAS8000

Registered User.
Local time
Yesterday, 17:33
Joined
Apr 3, 2018
Messages
38
hello,
I have a login form
i want to use the dim function to put the userlogin in the dash board form
i made

Dim getuser As Integer
getuser = [UserLogin.Value]
DoCmd.OpenForm "DashBoard"
Forms![DashBoard]!text5 = getuser

i think there is a problem in the syntax of [UserLogin.Value]
thank you
 

NauticalGent

Ignore List Poster Boy
Local time
Yesterday, 20:33
Joined
Apr 27, 2015
Messages
6,365
I assume this bit of code is on an event associated with your login form. That being the case, try:

Code:
Dim getuser As Integer
getuser =[COLOR="Red"] Me.[/COLOR]UserLogin.Value
DoCmd.OpenForm "DashBoard"
Forms![DashBoard]!text5 = getuser

Remove the brackets as well.

Also, the Value you have assigned to getuser will get lost once you open the form Dashboard. Best to pass the value as an OpenArg.

See Pbaldy's site for an example:
http://www.baldyweb.com/OpenArgs.htm
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Yesterday, 20:33
Joined
Jan 23, 2006
Messages
15,383
Maas8000,

Further to NG's advice, is the userLogin really an Integer, not text??
 

Users who are viewing this thread

Top Bottom