Results 1 to 2 of 2

Thread: Help writing to a new table with an SQL ...

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Location
    Decatur, AL US
    Posts
    14

    Post

    I'm using an Access database ... what I need to able to do is create another table and populate it with the information I'm selecting.

    I have ComboBoxes, being populated with AddNew statements (which comes from a table called Transcripts). I'm doing this with an SQL Select statement .. where StudID is equal to ...whatever .. then the student courses are listed in the ComboBoxes .. Then I need to be able to write what has been selected in the ComboBoxes to a new table (called checksheet) in the database .. I would like to do this with an SQL Statement ...

    Any Ideas ?


  2. #2
    Lively Member
    Join Date
    Jan 1999
    Posts
    82

    Post

    Hi,

    Try this:

    Dim sSQL As String
    Dim cn as Connection (ADO,DAO whichever)

    Connect to the database - I will assume that you already know how to do this.

    sSQL = "INSERT INTO checksheet (STUDID, COURSE) VALUES('" & cboStudid.text & "', '" _
    & cboCourse.text & "')"

    cn.execute sSQL

    cboStudid.text is the student ID combo box (I assumed that this was declared as string. If it not a string then remove the single quotes)

    cboCourse.text is the course combo box.

    Hope this helps,

    Preeti

Posting Permissions

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



Click Here to Expand Forum to Full Width