Results 1 to 5 of 5
  1. #1
    Japazo is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    6

    Control button on a report to change a field value?

    I have set up a system which allows our sales team to initiate a quote for a customer. One of the managers will then complete the quote, seeing that it has been initiated. If accepted, the quote will be converted into an open job where a bunch of documents are created. At the same time, a report will be updated to show that the new job has been created, so it can be entered into our financial system. What I would like to accomplish is to create a button which would appear for each record on the report (I have successfully created the button for each record...). I want the button to be tied to the record itself. Once the information has been entered into the financial system, I want our accountant to be able to hit the button and "delete" the record from the report so they can move on to the next job. I really just want the button to change the "job status" field to something other than "new job" so the record will no longer appear on the report.

    Is this possible? If so, how do I get the button to change the correct field? I'm sure the code or macro wouldn't be all that complicated, but how hard is it to have the button, which is automatically generated for each record, tied to its corresponding record and only effect that particular record?

    Any ideas are appreciated! Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You say 'report' but is this actually a form object? On a form can select record and hit Delete on the keyboard. On a report, expect will require VBA code and DELETE sql action statement.
    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
    Japazo is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    6
    Quote Originally Posted by June7 View Post
    You say 'report' but is this actually a form object? On a form can select record and hit Delete on the keyboard. On a report, expect will require VBA code and DELETE sql action statement.
    It is an actual report. All I really want is a quick way for accounting to clear the job from the "new jobs" list without having to navigate through forms. I would like them to be able to do everything from a single report.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What is 'new jobs' list?

    Reread original post. You don't actually want to delete a record, just change value in a field? Okay, that is an UPDATE sql action. In button click event, something like:

    CurrentDb.Execute "UPDATE tablename SET fieldname='some value' WHERE ID=" & Me.ID

    Never tried this from a report event. Good luck.
    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
    Japazo is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    6
    Quote Originally Posted by June7 View Post
    What is 'new jobs' list?

    Reread original post. You don't actually want to delete a record, just change value in a field? Okay, that is an UPDATE sql action. In button click event, something like:

    CurrentDb.Execute "UPDATE tablename SET fieldname='some value' WHERE ID=" & Me.ID

    Never tried this from a report event. Good luck.
    I've taken a few steps backward with my DB so this is on the back burner. Thank you for the help, I'll try it as soon as I get that far again!

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

Similar Threads

  1. how can change one control in whole rows
    By smahdih in forum Reports
    Replies: 5
    Last Post: 11-20-2011, 02:42 PM
  2. Replies: 30
    Last Post: 03-01-2011, 10:05 AM
  3. Replies: 0
    Last Post: 01-12-2011, 12:43 PM
  4. Change date from another control
    By NOTLguy in forum Forms
    Replies: 3
    Last Post: 11-20-2010, 11:24 AM
  5. Command button to change value of other field
    By teirrah1995 in forum Programming
    Replies: 8
    Last Post: 09-09-2010, 10:23 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