Please help :(( (1 Viewer)

dale_j1992

Registered User.
Local time
Today, 10:39
Joined
Sep 23, 2016
Messages
26
Good morning i have been having a problem trying to get some code working, any help is much appreciated. Basically i have the initial form which the user scans an ID Card to log them in, this works perfectly, however i have added the option to press a command button to which opens a second form to input username and password if they have forgotten there card, this also works how i expected. The issue i am getting is i make the password form hidden so i can still use the inputted data to refer to the person who is logged in, for instance when completed checks and i have a text box called USER_NAME on the top of the page which displays the user currently logged in.
i have the code working individually for each option using
USER_NAME=Forms![RFIDlogin]!username.value

USER_NAME=Forms![FRMLogin]!Cbouser.column(1)

however because the user could use either option leaving it in this state does not work so i have tried using this code.

If IsnotEmpty(Forms![RFIDlogin]!USERNAME.Value) Then
USER_NAME = Forms![RFIDlogin]!USERNAME.Value
Else
Exit Sub
If IsnotEmpty(Forms![Frmlogin]!cboUser.Value) Then
USER_NAME = Forms![Frmlogin]!cboUser.Column(1)
Else
Exit Sub

I am pulling my hair out and cannot get it to work, any information is greatly appreciated.

kind regards
 

Users who are viewing this thread

Top Bottom