Results 1 to 5 of 5
  1. #1
    peak@accessforums is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    4

    Update target where source <> ""

    Access 2013. I have two tables with the same structure, ML and MLTemp. I want to update ML from MLTemp whith the fields in MLTemp which are not empty, that is I want to avoid writing an empty value from MLTemp into a field in ML that has a value already.

    Is there a way to do that in VBA/SQL without looping through each field in MLTemp and check if it's not empty?

    Best regards


    George

  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,729
    George,

    Welcome to the forum.
    Just about anything is possible with some amount of programming. Databases are usually designed and built to support some type of business. And it often helps readers understand questions/opportunities when the business need is described.

    Having tables with exactly the same structure is not too common.

    You say you want to update fields in one table from another without using vba or sql.

    What you have described is often done using a query. But behind a query is sql. When you look at the query wizard you see a user interface, but behind that is SQL.

    Can you show readers your table designs? Screen capture of the table design window would help.

  3. #3
    peak@accessforums is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Mar 2015
    Posts
    4
    Hello Orange,

    I'm sorry but you totally misunderstood. Of course I want to use SQL and VBA. That's what I wrote. I don't want looping.

    Quote Originally Posted by orange View Post
    George,

    Welcome to the forum.
    Just about anything is possible with some amount of programming. Databases are usually designed and built to support some type of business. And it often helps readers understand questions/opportunities when the business need is described.

    Having tables with exactly the same structure is not too common.

    You say you want to update fields in one table from another without using vba or sql.

    What you have described is often done using a query. But behind a query is sql. When you look at the query wizard you see a user interface, but behind that is SQL.

    Can you show readers your table designs? Screen capture of the table design window would help.

  4. #4
    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,729
    Sorry for misunderstanding. Glad you clarified your point.
    What fields uniquely identify records in each table?
    What have you tried so far? What results occurred?
    Do you have an aversion to looping or is this just academic?
    It would still be useful to readers to see your table designs, field names and data types.

  5. #5
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    make a query of MLTemp; select a field and put in its criteria: Not Is Null

    this query then will result in only records with data

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

Similar Threads

  1. Replies: 4
    Last Post: 04-30-2014, 08:56 AM
  2. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  3. Replies: 5
    Last Post: 06-25-2012, 02:06 PM
  4. Replies: 4
    Last Post: 04-26-2012, 08:25 PM
  5. Replies: 13
    Last Post: 01-11-2012, 09:44 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