Results 1 to 3 of 3
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Update Query

    I'm trying to make an update query. The update query is [qrySchTransferEmpl]. I have filtered my table using another query [qrySchTransferEmpl2]. I need to update the field [SchDatesXSchMonthlyShifts] with the same field in the second query by date. That is, if it's the same date, I need to update that field. In my update query, I tried coding the "Update To" like this: DLookUp("SchDatesXSchMonthlyShifts",qrySchTransfer Empl2", "SchDate=" & [SchDate]). I'm not sure if this is even possible. Suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I am a little confused. The field you want to update is also the source field?

    Aside from that, your DLookup has syntax errors. Try:

    DLookup("SchDatesXSchMonthlyShifts", "qrySchTransferEmpl2", "SchDate=#" & [SchDate] & "#")

    Usually, a join on destination and source should be possible instead of DLookup.


    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    That worked perfectly. I keep forgetting about # and dates. Thanks.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-03-2017, 04:58 AM
  2. Replies: 1
    Last Post: 10-27-2016, 12:14 PM
  3. Query Update/Select Query (Wont Update)
    By NickWren in forum Access
    Replies: 1
    Last Post: 03-30-2016, 10:41 AM
  4. Replies: 7
    Last Post: 08-26-2013, 06:05 AM
  5. Replies: 2
    Last Post: 08-30-2012, 07:59 AM

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