Login user variables

L

Lez

Hi Guys,

I have a login form which I use to set various user variables as below:

If Me.txtPassword = Me.cboUser.Column(2) Then
UsrName = Me.cboUser.Column(1)
UsrPass = Me.cboUser.Column(2)
UsrUserID = Me.cboUser.Column(0)
UsrLevelID = Me.cboUser.Column(3)
UsrLocID = Me.cboUser.Column(4)
DoCmd.Close acForm, "frmLogin"

I have got a public module to store these variables:

Public UsrName
Public UsrPass
Public UsrUserID
Public UsrLevelID
Public UsrLocID

Function GetUsrName()
GetUsrName = UsrName
End Function

Function GetUsrPass()
GetUsrPass = UsrPass
End Function

Function GetUsrUserID()
GetUsrUserID = UsrUserID
End Function

Function GetUsrLevelID()
GetUsrLevelID = UsrLevelID
End Function

Function GetUsrLocID()
GetUsrLocID = UsrLocID
End Function

The problem I am having is that the UsrLocID variable simply returns 'null'
despite the field having a value...I am missing something very simple here
or is there another issue going on? can I only get a limited number of
variables ? I can confirm that column(4) is the correct column.

Many thanks
 
L

Lez

yes...I have just 5 columns

UserID (0)
UsrName (1)
UsrPass(2)
UserLevelID(3)
UsrLocID(4)

oddly, if I change the column to (3) and in the intermediate window enter
?UsrLocID I get the UserLevelID as I would expect, and like wise for any
other ColumnCount I use.

the UsrLocID defiantly has a value, but just keep getting null in the
intermediate window.

Regards
Lez
 
L

Lez

Well it would appear that the login process will only go up to column 3
after that all other variables are set to null???
 
D

Douglas J. Steele

And you've checked the ColumnCount property of the combo box and it's set to
5?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top