Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2006
    Posts
    6

    Question Unanswered: Select Record from a List Box Using a Command Button

    My question deals with two tables in my database.

    tblContacts
    tblActivities

    I have an unbound form with a listbox containing contact records that are derived from this SQL statement.

    SELECT qryContacts.FullName, qryContacts.ContactType, qryContacts.CompanyName, qryContacts.WorkPhone, qryContacts.Email FROM qryContacts ORDER BY qryContacts.FullName;

    I would like to be able to select (highlight) a record in the listbox and click a command button (cmdNewAcitivity) that to open a form (frmNewActivity) that will allow me to enter an activity for the selected contact.

    Table
    tblContact
    Fields
    ContactID
    FirstName
    LastName
    CompanyID
    WorkPhone

    Table
    tblActivity
    Fields
    ActivityID
    Type
    Status
    Date

    Thanks!!!
    James

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    So ... Do it. Or did you have a question?
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jul 2006
    Posts
    6
    I was looking for some direction on how to make the command button open a data-entry form (frmNewActivity) for the contact selected in the listbox.

    I.e. when I click the command button (cmbNewActivity) it opens up frmNewActivity with the corresponding ContactID from the contatct highlighted.

    Direction, code, help..........or you could just do it (just kidding)

    Any help would be greatly appreciated. I could send a copy of the database if that would help.

    Regards,

    James Andrews
    jandrews@carterusa.com
    (404) 888-3398

  4. #4
    Join Date
    Jul 2006
    Posts
    108
    if im understanding you right, you can simply use the command button wizard to open the form and click the checkbox next to "open the form and find specific data to display" and then it should be easy from there.

  5. #5
    Join Date
    Feb 2004
    Posts
    90
    If activities are linked to contacts then you at least need a ContactID
    (foreign key) field in the tblActivity table as a starter.

  6. #6
    Join Date
    Jul 2005
    Posts
    144

    Talking Hope this helps

    I hope this helps!
    Attached Files Attached Files

  7. #7
    Join Date
    Jul 2006
    Posts
    6

    Talking Thanks!!!!!

    Quote Originally Posted by ranjah
    I hope this helps!
    This is perfect...I appreciate the help.

  8. #8
    Join Date
    Jul 2005
    Posts
    144

    Wink

    Quote Originally Posted by jandrews404
    This is perfect...I appreciate the help.
    Your welcome!
    glad to help

Posting Permissions

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