Results 1 to 3 of 3
  1. #1
    T 5 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    3

    Help on VBA/SQL update query.

    Dear All,

    Could I ask for some help in coding a VBA update query please?

    I have a table tblPriceList which contains a field SupplierID.

    I want to create an Update query in VBA/SQL, in an after-update event of a combo named Combo45.

    The SupplierID’s within the table I want to change will be equal to a value shown in a text box (on a form) called txtDispVariable. I want all the ID’s to change to the Combo45 bound column.

    I am not sure if this is required but, Combo45 and txtDispVariable are located on the same form called frmProductSuppliers.

    Not sure if there are any other details required.

    Thanks and regards

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    see Martin Green's tutorials on vba/sql

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    It will be something like:

    UPDATE tblPriceList
    SET [SupplierID] = " & forms!frmProductSuppliers!Combo45
    where [SupplierID] = " & forms!frmProductSuppliers!txtDispVariable

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  2. Replies: 1
    Last Post: 05-17-2013, 12:53 PM
  3. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  4. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  5. Replies: 1
    Last Post: 08-19-2011, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums