Results 1 to 6 of 6
  1. #1
    Polarbilly is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    13

    Opening a second form from one of several and then opening at a specific record

    I want to filter a form on the [ID] field and then open another form at that Record No. However, I also want to use the value in the [Test Group] field to determine which form to open. For example if [Test Group] = FR open 'flammable fabric' Form, if Test Group = FC open 'Fabric Colour' Form, and so on. How can I create this for a series of Forms??



    I'm now using Access 2010
    Last edited by Polarbilly; 01-23-2015 at 09:13 AM. Reason: missed out Access Edition

  2. #2
    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 would use Select/Case to test the group field and open the appropriate form. I'd use this to filter.

    http://www.baldyweb.com/wherecondition.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Polarbilly is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    13
    Sorry but I'm obviously very dim...I understand how to use the open at the same record, but which part relates to opening a form based on the value in [Test group]- in my naivety I thought there would be an If statement incvolved...help, drowning

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    If Then Else

    and

    Select Case

    are two conditional branching structures. Either can be used but Select Case is 'cleaner' for this situation. Something like:

    Dim strFm As String
    Select Case Me![Test Group]
    Case "FR"
    strFm = "flammable fabric"
    Case "FC"
    strFm = "fabric color"
    End Select
    DoCmd.OpenForm strFm, , , "ID=" & Me!ID

    Search Bing or Google for more guidance on these code structures.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  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'll get out of the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Polarbilly is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    13
    Thanks for the prompt and helpful replies - can't try it for a couple of days but I'll let you know how I get on...

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

Similar Threads

  1. Replies: 2
    Last Post: 07-08-2014, 11:15 AM
  2. Replies: 29
    Last Post: 01-29-2014, 01:04 PM
  3. Replies: 4
    Last Post: 12-13-2013, 04:50 PM
  4. Opening Form to a Specific Record
    By PPat in forum Forms
    Replies: 9
    Last Post: 04-24-2013, 08:47 PM
  5. Help with opening form to specific record
    By manic in forum Programming
    Replies: 7
    Last Post: 09-18-2012, 08:44 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