Results 1 to 4 of 4

Thread: Unbound Combo

  1. #1
    Join Date
    May 2004

    Unanswered: Unbound Combo.......Pls Help

    I have unbound combo box on my frmMain. How can i save the value from unbound combo box to my table ?

    I'm using tblLookUp for combo box and each time user selects the value from combo box i would like to save it in tblSection. tblSection and tblLookUP (1 to M)

    Thanks In Advance
    Last edited by SAK2004; 06-22-04 at 14:56.

  2. #2
    Join Date
    Jun 2004
    Terrapin Nation
    The easiest way is to create an insert query and use the value in the combo box as the value to insert.

    A more elegant way would be to create a recordset and insert it in programatically.

  3. #3
    Join Date
    May 2004
    Can u give me an example or walk me thru it ?

    I have never done this

  4. #4
    Join Date
    Feb 2004
    Check out the "docmd.RunSQL" method in the help files. The following was taken from the help files.

    The following example updates the Employees table, changing each sales manager's title to Regional Sales Manager:

    Public Sub DoSQL()

    Dim strSQL As String

    strSQL = "UPDATE Employees " & _
    "SET Employees.Title = 'Regional Sales Manager' " & _
    "WHERE Employees.Title = 'Sales Manager'"

    DoCmd.RunSQL strSQL

    End Sub
    Just build your SQL statement in VB as they do in the example and then run it using DoCmd.RunSQL strSQL.

    It's a very powerful way to handle simple tasks that are easiest to do using SQL statements without having to create an actual function or stored procedure to do it.

    If you need help on how to write an Update or Insert query check the SQL Server books online or do a google search.

    Good luck, let us know if you need any more 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