Results 1 to 7 of 7
  1. #1
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    Select Case To Open Separate Forms

    Hello Forum,

    I am having a problem with using Select Case to differentiate different employees when they log in to their respective section forms.

    Can someone help me out this Christmas?

    Merry Christmas



    Haziq
    Attached Files Attached Files

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Your db can't be opened by 2007 due to incompatible features you have used. Suggest you post an older version, or remove those features and re-post, or post the Select Case code to get more responses.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    Case Select

    Hello,
    Micron

    Thanks for the reply in this festive season.

    I do not know what is causing the not backward compatible so I take screenshots to explain.

    My Select Case does not even work.

    What I would like to do is to group the employees based on employees.

    Open separate forms based on their Section.

    Currently, I have only created Form for [Section] = "Elec".

    I hope you can help. If you need any clarification. Ask me.

    Thanks, And Merry Christmas

    Haziq
    Attached Files Attached Files

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Better to copy/paste the sql. Opening zipped images (which aren't very clear anyway) is more work than it needs to be.
    I'm going to say Access has no idea what [Section] is on the line Select Case [Section]
    You probably should say Me.Section.
    For such issues, put a break on a code line and cause the code to be executed as it normally would. Then step through the code (F8) and check the value of references such as variables or form control references. Sometimes mousing over is enough. Sometimes you have to check via the Immediate window by typing a question mark then the reference (e.g. ?[Section]) Using this example, I'd bet you'd get an error message as the reference is ambiguous. There may be other issues, but at this point I see no evidence that [Section] has been properly identified.

  5. #5
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124
    It is working!

    Thanks a million.

    Merry Christmas

  6. #6
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    My thoughts,

    In table "tblEmployees", the field names "Password" and "Section" are reserved words - shouldn't be used as object names.
    In table "tblDesc", the field name "Memo" is a reserved word - shouldn't be used as an object name.


    Why is the relationship between "tblMaster" and "tblDesc" a 1-to-1 relationship?
    To me, this is wrong - if truly a 1-to-1, then the fields should be in the same table.

  7. #7
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124
    Hello,

    Steve

    Thanks for looking @ my thread.

    I will make the changes. I didn't know I was using reserved keywords. There are too many for me to keep track. I will try to remember them.

    The reason why I put in another table is because it refers to the item and the list is long-winded. I will make the changes. Now you told me it is wrong table relationship.

    Thanks for the advice. I will make the necessary changes as required.

    Merry Christmas

    Haziq

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

Similar Threads

  1. Pl sql case select
    By mrmmickle1 in forum Queries
    Replies: 1
    Last Post: 11-17-2015, 11:14 PM
  2. Should I /can I use a Select Case statement?
    By Gina Maylone in forum Access
    Replies: 1
    Last Post: 12-13-2014, 12:08 PM
  3. Replies: 5
    Last Post: 07-18-2014, 02:04 AM
  4. Select case help
    By killermonkey in forum Programming
    Replies: 7
    Last Post: 10-25-2013, 05:09 PM
  5. VBA for SELECT CASE logic
    By rlsublime in forum Programming
    Replies: 1
    Last Post: 12-04-2012, 09:09 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