Results 1 to 5 of 5
  1. #1
    andy-29 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Culver City
    Posts
    34

    Autoupdate Record

    Click image for larger version. 

Name:	AutoUpdateRequestStatus.png 
Views:	10 
Size:	11.1 KB 
ID:	10164
    Form [Edit Marker Info]



    I would like to create an after update event on Text Box[MMReleased], when updated it would trigger an update query.

    The query will update the value of a field[RequestStatus] on table[Requests] to “Completed”.
    But it should only do this on the matching current record being modified.
    Record is based on [StyeID]
    Attached Files Attached Files
    Last edited by andy-29; 11-28-2012 at 05:52 PM. Reason: Attached DB

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    CurrentDb.Execute "UPDATE Requests SET RequestStatus='Completed' WHERE StyleID=" & Me.cboStyleID
    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
    andy-29 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Culver City
    Posts
    34
    Private Sub MMReleased_AfterUpdate()

    CurrentDb.Execute "UPDATE Requests SET RequestStatus='Completed' WHERE StyleID=" & Me.cboStyleID

    End Sub

    I get an error when executing
    Click image for larger version. 

Name:	Error 3075.jpg 
Views:	7 
Size:	5.6 KB 
ID:	10172

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I made assumption StyleID was number. Since it is text, need apostrophe delimiters.

    CurrentDb.Execute "UPDATE Requests SET RequestStatus='Completed' WHERE StyleID='" & Me.cboStyleID & "'"
    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.

  5. #5
    andy-29 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Culver City
    Posts
    34
    That worked, thank you very much!

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

Similar Threads

  1. Replies: 3
    Last Post: 10-19-2012, 04:30 PM
  2. Replies: 3
    Last Post: 08-26-2012, 10:04 PM
  3. Replies: 5
    Last Post: 08-21-2012, 12:30 PM
  4. Replies: 14
    Last Post: 05-25-2012, 02:40 AM
  5. Need Reports to AutoUpdate
    By Silver Rain 007 in forum Reports
    Replies: 5
    Last Post: 10-16-2009, 07:28 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