Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    173

    Unanswered: ListBox Issues - Go To Record - Open Form

    I have 2 ListBox Issues

    1. I would like to open a form to display data when a ListBox Item is Double Clicked

    Example:

    I have a form with a ListBox showing

    ContactID(hidden) - Contact1 (visible)
    ContactID(hidden) - Contact2 (visible)
    ContactID(hidden) - Contact3 (visible)

    When I Double- Click Contact 1, I would like to open a form (frmContacts) that matches the ContactID of Contact 1

    2. I would like to display data related to the ListBox Selection (on the same form)

    Example:

    I have a form with textboxes:

    ContactID
    ContactName
    Phone


    Also I have a Listbox with :

    ContactID(hidden) - Contact1 (visible)
    ContactID(hidden) - Contact2 (visible)
    ContactID(hidden) - Contact3 (visible)

    When I Click, or Select on Contact1, or on Contact2, etc.., I'd like the textboxes to show related data for that particular Contact


    Thanks in Advance - AB

  2. #2
    Join Date
    Nov 2004
    Posts
    32
    Instead of trying to use the double click event, what if you let the user select the record from the combo box and then use the on click event of a button to open the form. With the on click event procedure you would write something like this:

    DoCmd.OpenForm "<FormName>", , ,"<field1> = " & Me.<ComboxboxName>

    This works if field1 is a number data type. if field1 is a text data type you will have to write it like this:

    DoCmd.OpenForm "<FormName>", , ,"<field1> = '" & Me.<ComboxboxName> & "'"

Posting Permissions

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