+ Reply to Thread
Results 1 to 3 of 3

Reference A Combobox On The First page.

  1. #1
    Sean
    Guest

    Reference A Combobox On The First page.

    I have a combobox ( named "ddCity" ) placed on the first page of a
    worksheet. On the Activate event of ANY other worksheet, I want to
    display a polite message indicating they need to choose a city, first.

    How do I reference the combobox?

    Something like...

    If isnull(Worksheets("Main").ComboBox("ddCity").value) = True Then
    MsgBox "Please Choose A City."
    Worksheets("Main").ComboBox("ddCity").Select
    Exit Sub
    End If


  2. #2
    Tom Ogilvy
    Guest

    Re: Reference A Combobox On The First page.

    Private Sub Worksheet_Activate()
    If Worksheets("Main").ddCity.Value = "" Then
    MsgBox "Please Choose A City."
    Worksheets("Main").Select
    Worksheets("Main").ddCity.Activate
    Exit Sub
    End If

    End Sub


    This assumes ddcity is the name of an activeX combobox from the control
    toolbox toolbar and the name ddcity is set in the name property when you
    right click on it in design mode and select properties.


    Tested and worked for me.
    --
    Regards,
    Tom Ogilvy



    "Sean" <[email protected]> wrote in message
    news:[email protected]...
    > I have a combobox ( named "ddCity" ) placed on the first page of a
    > worksheet. On the Activate event of ANY other worksheet, I want to
    > display a polite message indicating they need to choose a city, first.
    >
    > How do I reference the combobox?
    >
    > Something like...
    >
    > If isnull(Worksheets("Main").ComboBox("ddCity").value) = True Then
    > MsgBox "Please Choose A City."
    > Worksheets("Main").ComboBox("ddCity").Select
    > Exit Sub
    > End If
    >




  3. #3
    JohnELaw
    Guest

    Re: Reference A Combobox On The First page.

    Thank you very much! That works perfect!


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1