Results 1 to 8 of 8
  1. #1
    Synergy.ron@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    126

    Can youi please look at this?


    Views: Size: ">Attachment 45902
    I HAV A SELECT CASE AND END CASE BUT VBA SAYS I DON'T HAVE A SELECT CASE?????(END CASE WITHOUT SELECT CASE) HUH? WHAT AM I MISSING?


    Code:
    Code:
     Select Case auth
      '================
      Case True
      '------------
           Debug.Print auth & "<<auth"
            Set rs = Nothing
           Exit Sub
       Debug.Print s3 & "  " & s4
             
    ' End If
         Set rs = Nothing
         Exit Sub                       'onload()  don 't need to check sn/pw
    '-------------------------
    Case False                               'auth is false not authorized
    '-------------------------
    s3 = rs.Fields![serialnum]
    s4 = rs.Fields![password]
    If Not IsNull(s3) Then           'serial exists
                   If s4 <> "DEMO" And Not IsNull(s4) And Not IsNull(s3) Then     'valid serial, invalid pw
                   s4 = gettauthcode(s3)         'get new auth code
                   End If
                   Exit Sub
               '= = = = = = = = = = =
        If (IsNull(s3) Or IsNull(s4)) Then ' serial is null or password is null
           GettSerial   'which also calls gettauthcode(s3)
           Debug.Print s3; s4
              rs.Fields![seralnum] = s3
              Debug.Print s3 & "<<<<s3"
              Call gettauthcode(s3)
              Debug.Print s4 & "<<<S4"
              Me.[chkauth] = False
              rs.Fields![Authorized] = False
       Else                 'not null(s3)
         If Len(s3) <> 6 And (Val(s3) < 111111 Or Val(s3) > 999999) Then            '     not isnull(s3)
         Call GettSerial     'get new serial &auth code
         End If
       End If
    End Select
    Last edited by Synergy.ron@gmail.com; 08-03-2021 at 03:25 PM. Reason: ADD ERR MSG

  2. #2
    rmceu1 is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2021
    Posts
    5
    I believe you need one more End If just before End Select

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    you've only shown part of your code, so impossible to say. recommend repost and remove all the commented out lines

  4. #4
    Synergy.ron@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    126
    Quote Originally Posted by rmceu1 View Post
    I believe you need one more End If just before End Select
    dO YOU THINK THE COMPILERERR MSG IS APPROPRIATE?Attachment 45903

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I agree with rmceu1, and the error message is not necessarily relevant. Access only knows that something is out of balance; it's not sure what, so it mentions the Select/Case. You appear to be missing an End If for this:

    If Not IsNull(s3) Then

    Fix that and the error goes away.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Synergy.ron@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    126
    Shouldn't the message be something like 'Missing Endif'?

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Quote Originally Posted by Synergy.ron@gmail.com View Post
    Shouldn't the message be something like 'Missing Endif'?
    Ideally yes. It seems like it doesn't analyze to that degree, just knows something is out of whack.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Synergy.ron@gmail.com is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    washington
    Posts
    126
    thanks paul

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

Tags for this Thread

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