Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Posts
    7

    Unanswered: sql insert statment from list box to other from

    Hi everbody,

    How would you insert records using sql statement from a list box to another form.

    See example. Main frorm Is member. If you look at the combo box called cmbzip there are 2 cities associated with the same zip code. i want the frm called frmZipcodeSearch To open to make user aware there are 2 cities associated with the zipcode they just entered and on the frmZipcodeSearch there is a list box.

    What i want to do is have user double click the correct city from the list box and insert that record on the form called frm member.


    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    mmmm
    perhaps we have a terminology issue.

    sql INSERT goes into a table (not form (unless form is looking at the table (or a query looking at the table) and you .requery the form after INSERTing into the table))
    ...slightly sorry for the compound parentheses

    so what do you want to do?
    grab data from comboXX on formYY and INSERT it into tableZZ?
    grab data from comboXX on formYY and copy into a textboxVV on formWW
    or ?

    sorry - did not download your example (bad habit of mine)

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Aug 2007
    Posts
    7

    Got it working how to check for duplicate zipcodes.

    Okay i manage 2 write some code to get it working see attach. I added a command button to open the list box and now you could double click the list box and insert the records on the form and table.

    Example

    Los Angeles 91105
    Pasadena 91105

    Now i need to add code to see if the zipcode is associated with more then one city. I want the frmZipcode search to automatically open once user enters the zipcode in the combo box on member form if its associated with more then one city.
    Attached Files Attached Files

Posting Permissions

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