Results 1 to 3 of 3
  1. #1
    PinkDuster's Avatar
    PinkDuster is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2017
    Location
    Cleveland area
    Posts
    65

    Macro to check box and save record

    I have 3 cases for saving orders in my database:

    1) Save as a Quote
    2) Save but wait for payment (Hold)
    3) Save as Complete and debit inventory

    The Order table has two fields with checkboxes, one for Quote and one for Hold. The default value is “false” for both.

    I have a button on the Order from with VBA to save the record and debit the inventory, but would like two more: one for Quote and one for Hold. I could manually check either box and just save the record, but would like to have two additional buttons and avoid the possibility of checking both fields.



    The Quote button would set the Quote field to True and save the record. The Hold button would set the Hold field to True and save the record. Order takers will know to choose one of the three options, Quote, Hold, or Complete.

    Can I use a Save Record macro to also update one of the checkbox fields prior to saving, or do I need to use VBA code behind the buttons?

    I’ll need to revisit Quotes and Holds to update their status periodically and have set up queries to identify those.

    Thank you!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Macro has action called SetValue.

    I don't use macros, only VBA.
    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
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Your setup seems un-normalized (e.g. you will have to add a field if another situation needs to be covered - a sure sign). Maybe you have a spreadsheet type design throughout instead of being normalized.
    Methinks you ought to have a field "Status" with values such as Hold, Complete, Quote. That would mean that a new additional value would not require an additional field. A date field for complete might also be of some value, as it not only denotes the order is complete (when not null) but also provides the when. However, you would not usually use 2 fields to provide the same status information. Maybe check out
    Normalization Parts I, II, III, IV, and V
    http://rogersaccessblog.blogspot.com...ng-part-i.html
    and/or
    http://holowczak.com/database-normalization/
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 9
    Last Post: 11-14-2018, 01:32 PM
  2. No save prompt after Yes/No (check box)
    By Bradex in forum Forms
    Replies: 3
    Last Post: 08-02-2017, 01:54 AM
  3. Replies: 3
    Last Post: 10-08-2012, 08:40 AM
  4. Replies: 8
    Last Post: 09-27-2012, 11:12 AM
  5. A save macro
    By Sune in forum Programming
    Replies: 4
    Last Post: 11-09-2011, 04:36 AM

Tags for this Thread

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