Results 1 to 11 of 11
  1. #1
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19

    Question about Creating a type of Dynamic Form

    Hello all, I am new to the forum and Access for that matter. I am creating a VLAN database for work and I have an idea in my head but I am not sure if it is possible. I am needing to create a database along with a form. My form Will have multiple inputs but there is one inparticular that I am wanting to work.

    The selection field added to the form will be called WAN Service and you will have 2 choices. (I have a table created with these two options and a combo box is pulling the two fields in to choose.)

    -Point-to-Point
    or
    -Point-to-Multi-Point

    With Point-to-Point selected I want to Have only Fields Location A and Location B show up to fill out on the form.

    With Point-to-Multi-Point selected I want it to Show Location A through Location Z fields to fill out on the form.



    I have all my fields in my VLAN database that List Location A to Location Z.

    Is this possible?

  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,521
    Not sure the db is normalized, but:

    http://www.baldyweb.com/ConditionalVisibility.htm

    With that many fields, I'd probably use the Tag property of C-Z and a loop of controls.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    I attempted to do some coding on my own but keep running into errors.

    Here is what I tried to use. The LocationA, LocationB, ect...are the Names on the Other tab in the property sheet for the text box

    Option Compare Database


    Private Sub cboGoToRecord_AfterUpdate()
    On Error Resume Next
    Dim rst As Object
    Set rst = Me.RecordsetClone
    rst.FindFirst "[Vlan Number]=" & Me.cboGoToRecord.Value
    Me.Bookmark = rst.Bookmark
    End Sub


    Private Sub WANSERVICE_AfterUpdate()
    If Me.WANSERVICE = "[Point to Multi-Point]" Then
    Me.LocationA.Visible = True
    Me.LocationB.Visible = True
    Me.LocationC.Visible = True
    Me.LocationD.Visible = True
    Me.LocationE.Visible = True
    Me.LocationF.Visible = True
    Me.LocationG.Visible = True
    Me.LocationH.Visible = True
    Me.LocationI.Visible = True
    Me.LocationZ.Visible = True
    Else
    If Me.WANSERVICE = "[Point to Point]" Then
    Me.LocationA.Visible = True
    Me.LocationB.Visible = False
    Me.LocationC.Visible = False
    Me.LocationD.Visible = False
    Me.LocationE.Visible = False
    Me.LocationF.Visible = False
    Me.LocationG.Visible = False
    Me.LocationH.Visible = False
    Me.LocationI.Visible = False
    Me.LocationZ.Visible = True
    End If
    End Sub

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by jlyalls View Post
    I attempted to do some coding on my own but keep running into errors.
    What are the error(s)? You Don't want the second If statement in there; the Else will handle it.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    I get a compile error. Block If without End If. I attempted to try this also with no success but no errors.

    Private Sub WANSERVICE_AfterUpdate()
    If Me.WANSERVICE = "[Point to Point]" Then
    Me.LocationA.Visible = True
    Me.LocationB.Visible = False
    Me.LocationC.Visible = False
    Me.LocationD.Visible = False
    Me.LocationE.Visible = False
    Me.LocationF.Visible = False
    Me.LocationG.Visible = False
    Me.LocationH.Visible = False
    Me.LocationI.Visible = False
    Me.LocationZ.Visible = True
    End If
    End Sub


    I am trying to see when I pick either of the two then I will see the other fields disappear. Thanks for your help. I will be back in the office tomorrow at 8am.

    Thank you!

    Josh

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You should be able to just delete this line from the first effort:

    If Me.WANSERVICE = "[Point to Point]" Then
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    Ok I feel like I am close...I tried what you said to do...and When I clicked on one of the options it took away everything but LocationA and LocationZ...but after that It would not change back to show all of the other locations. Even after I deleted the event coding it still only shows the LocationA and LocationZ. I did hit save after doing this as well. Here are the images of what I am seeing and of my design view of the form.

    Thanks

    Click image for larger version. 

Name:	Form_View_VLAN_Data.PNG 
Views:	17 
Size:	17.4 KB 
ID:	24413

    Click image for larger version. 

Name:	Form_View_VLAN_Data2.jpg 
Views:	16 
Size:	221.1 KB 
ID:	24414

  8. #8
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    Actually I messed around some more this morning and got the code to work correctly!!! I took off the brackets on the Point to Multi-Point also and this was one issue I believe.

    Thank you for your help pbaldy!!!

    Here is the code that was successful

    Private Sub WANSERVICE_AfterUpdate()
    If Me.WANSERVICE = "Point to Multi-Point" Then
    Me.LocationA.Visible = True
    Me.LocationB.Visible = True
    Me.LocationC.Visible = True
    Me.LocationD.Visible = True
    Me.LocationE.Visible = True
    Me.LocationF.Visible = True
    Me.LocationG.Visible = True
    Me.LocationH.Visible = True
    Me.LocationI.Visible = True
    Me.LocationZ.Visible = True
    Else
    Me.LocationA.Visible = True
    Me.LocationB.Visible = False
    Me.LocationC.Visible = False
    Me.LocationD.Visible = False
    Me.LocationE.Visible = False
    Me.LocationF.Visible = False
    Me.LocationG.Visible = False
    Me.LocationH.Visible = False
    Me.LocationI.Visible = False
    Me.LocationZ.Visible = True
    End If
    End Sub

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    jlyalls is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    19
    I have another quick question if you or someone else can help. After I complete this database with its forms and tables...what would be the best way to allow other employees to use just the form and not have to open access? Our company expense form uses a web browser, but are there other options?

    Thanks!

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you've created this with the desktop version, the employee will have to have Access. There is a free runtime version available from Microsoft, so you don't have to pay for the full version for every employee. You can hide the nav pane and just have your form open.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Creating a Form for Dynamic Table
    By Ashe in forum Forms
    Replies: 7
    Last Post: 02-25-2014, 12:10 PM
  2. Help creating a specific type of form
    By an amicable guy in forum Forms
    Replies: 1
    Last Post: 11-12-2013, 11:40 AM
  3. Creating a Dynamic Query
    By gdshih in forum Queries
    Replies: 4
    Last Post: 11-28-2011, 02:13 PM
  4. Creating dynamic hyperlinks
    By mattellenburg in forum Access
    Replies: 1
    Last Post: 11-28-2011, 10:31 AM
  5. Creating a Dynamic Query
    By JackRush in forum Queries
    Replies: 2
    Last Post: 06-26-2011, 10:47 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