Form Combobox Problem
Find bottlenecks in your Excel workbooks
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Form Combobox Problem

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi all,

    Can't figure this out. I have a combo box from the excel forms toolbar. From the combobox I call document names from a database into a cell (m14 in code below) using index and match functions.The macro behind the combo box then opens the selected document on the selection click. My problem is that if the combobox is on a particular selection (say file abc.xls), I cannot open that file until I have selected a different file (say file def.xls to in effect reset the combo box.

    How do I get the combo box to work on the current selection without the 'reset'?

    Thanks!

    My code behind the forms toolbar cbox is below:

    Sub OpenGrant()
    Dim Filename As String

    On Error GoTo errtrap
    Filename = Range("m14").Text

    Workbooks.Open Filename:=Filename
    Sheets("Main Menu").Select
    Range("A8").Select
    Exit Sub
    errtrap:
    Dim nofilemsg
    nofilemsg = MsgBox("No File Exists Please See Coordinator Information", vbOKOnly + vbExclamation, "System Alert")

    End Sub

  2. #2
    New Member
    Join Date
    Mar 2002
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    Any thoughts on this one?

    Thanks again!

  3. #3
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Not too sure I have understood you but I would think you would be better of using a ComBobox from the Control toolbar. These have many Events that will allow you to trap the you current selection.

  4. #4
    New Member
    Join Date
    Mar 2002
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Dave,

    Thanks for the response. I have tried changing it to a control toolbar cbox, and it still is not capturing the current selection. Is there something under properties for the cbox I should change?

    Thanks!

  5. #5
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    GBOB

    Use the Control toolbar to go into Edit mode, then double click the ComboBox and place in this.

    Private Sub ComboBox1_Change()
    If ComboBox1.ListIndex > -1 Then
    MsgBox ComboBox1
    End If
    End Sub




User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com