Results 1 to 3 of 3
  1. #1
    Lesg is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2021
    Posts
    101

    Understanding Functions and their use

    Hi Guys, I am trying to get my head around a module that has function defined:

    Code:
    Public UsrName
    Public UsrPass
    Public UsrFullName
    Public UsrUserID
    Public UsrUserLevelID
    
    
    Function GetUsrName()
        GetUsrName = UsrName
    End Function
    
    
    Function GetUsrPass()
        GetUsrPass = UsrPass
    End Function
    
    
    Function GetUsrFullName()
        GetUsrFullName = UsrFullName
    End Function
    
    
    Function GetUsrUserID()
        GetUsrUserID = UsrUserID
    End Function
    These values are retrieved from tblUsers which has columns:
    UserID
    UserName
    FullName
    Password
    UserLevel

    If I check for these in the immediate window I can get the results of each function. However, I need to add a funtion the get the userlevelid and have added the following to the functions:

    Function GetUsrUserLevelID()
    GetUsrUserLevelID = UsrUserLevelID
    End Function

    However, when I test this, it does not return a value as expected.



    Now its been years since I looked at this, so think I am missing something important here, but do not know what, can anyone advise please?

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    have you assigned a value to is as you presumably have for the other variables?

  3. #3
    Lesg is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Sep 2021
    Posts
    101
    ok guys, I have figured it out, I have not defined 'UsrUserLevelID' to the column on the login form, so sorted now


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 05-19-2021, 10:00 AM
  2. Querie Understanding
    By Joshwenny in forum Access
    Replies: 3
    Last Post: 07-16-2018, 06:13 PM
  3. understanding Enums
    By George in forum Modules
    Replies: 9
    Last Post: 08-28-2017, 07:43 PM
  4. Am I understanding many to many?
    By dniezby in forum Database Design
    Replies: 10
    Last Post: 04-12-2017, 06:21 PM
  5. Understanding relationships
    By Skywalk669 in forum Database Design
    Replies: 4
    Last Post: 05-01-2012, 03:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums