Results 1 to 8 of 8
  1. #1
    newbie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2009
    Posts
    34

    Cool Need Duplicate List Box


    I have a form that contains tab. Tab 1 and 2 display information based off of a list box selection. The list box is identical on both tabs. I would like for them to by in sync. So, if a user selects item 1 on tab 1 when they go to tab 2 item will will be highlighted in the listbox. Is this possible?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If you put just one ListBox on the form instead of a page of the tab, it will show up on both tabs. Does that help?

  3. #3
    newbie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2009
    Posts
    34
    That is how I had it originally, however the list box does not pertain to all the other tabs that I have, so I was loosing a lot of space to display information.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I thought you only had two tabs, sorry. How about playing with setting it invisible when you are on a page where you don't want it? You can use the Tab Control's Change event for this.

  5. #5
    newbie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2009
    Posts
    34
    Can you give more detail on this option? I placed the listbox on the form, so it now displays on all of my tabs (pages). Then I went to one of the pages I do not want the list box to be visible on and accessed the properties/events. The only events I can see are On Click, On Double Click, On Mouse Down, On Mouse Move, and On Mouse Up.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You are on a Tab Page. You need to select the TabControl which is usually named TabCtl & number. The Index of the TabControl tells you what page you are on so you can just have a case statement to set the visible property of the ListBox.
    Code:
    Private Sub TabCtl0_Change()
       Select Case Me.TabCtl0.Value
          Case Is < 2
             Me.ListBoxName.Visible = True
          Case Else
             Me.ListBoxName.Visible = False
       End Select
    End Sub
    ...using your control names of course.

  7. #7
    newbie is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2009
    Posts
    34
    You are amazing!!! This worked perfect. This coding stuff is adicting :0)

    Thanks for all you help.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad that worked for you and you're welcome. Try the link in my sig.

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

Similar Threads

  1. duplicate autonumber
    By rayc in forum Access
    Replies: 5
    Last Post: 06-19-2013, 07:50 AM
  2. List box to populate other list boxes
    By Nathan in forum Forms
    Replies: 0
    Last Post: 03-03-2009, 07:22 PM
  3. Duplicate command button
    By brettg in forum Database Design
    Replies: 1
    Last Post: 08-04-2008, 04:16 AM
  4. Duplicate add to new table
    By horseyshoe in forum Access
    Replies: 3
    Last Post: 09-01-2006, 07:51 AM
  5. Which duplicate?
    By grgerhard in forum Import/Export Data
    Replies: 1
    Last Post: 05-27-2006, 06:19 AM

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