I have created a type called :
Type userDefaults
userID as Integer
useraddress as string
userpermissions as string
End type
There is a login screen called frmlogin
in there is a function call to : Call getUserDefaults(Me!UserID)
The Module getUserDefaults looks like this:
Public Function getUserDefaults (UserID)
Dim dbs As Database
Dim rstUserIndex As Recordset
Dim CurrentuserDefault As userDefaults
Set dbs = currentdb
Set rstUserIndex= dbs.OpenRecordset(" SELECT * _
& "FROM tlbUserIndex " _
& " WHERE (tlbUserIndex.[UserID]=" & UserID & ");")
'User Defaults
CurrentuserDefault.userID = rstTownIndex!userID
CurrentuserDefault.useraddress = rstTownIndex!useraddress
CurrentuserDefault.userpermissions = rstTownIndex!userpermissions
rstTownIndex.close
end Function
'____________________________________________________
Ok, now the problem I want to be able to refer to the defined types in any form or module. It does not!
For example if I open the form : frmNewInvoice with the openevent :
Private Sub Form_Open(Cancel As Integer)
Dim UserStuff As userDefaults
Me!User = UserStuff.userID
Then Me!User has no value, why is it not pulling the userID value??
Does it have something to do with Private v. Public variables.
I'm stumbed!
Thanks in advance
Type userDefaults
userID as Integer
useraddress as string
userpermissions as string
End type
There is a login screen called frmlogin
in there is a function call to : Call getUserDefaults(Me!UserID)
The Module getUserDefaults looks like this:
Public Function getUserDefaults (UserID)
Dim dbs As Database
Dim rstUserIndex As Recordset
Dim CurrentuserDefault As userDefaults
Set dbs = currentdb
Set rstUserIndex= dbs.OpenRecordset(" SELECT * _
& "FROM tlbUserIndex " _
& " WHERE (tlbUserIndex.[UserID]=" & UserID & ");")
'User Defaults
CurrentuserDefault.userID = rstTownIndex!userID
CurrentuserDefault.useraddress = rstTownIndex!useraddress
CurrentuserDefault.userpermissions = rstTownIndex!userpermissions
rstTownIndex.close
end Function
'____________________________________________________
Ok, now the problem I want to be able to refer to the defined types in any form or module. It does not!
For example if I open the form : frmNewInvoice with the openevent :
Private Sub Form_Open(Cancel As Integer)
Dim UserStuff As userDefaults
Me!User = UserStuff.userID
Then Me!User has no value, why is it not pulling the userID value??
Does it have something to do with Private v. Public variables.
I'm stumbed!
Thanks in advance