Results 1 to 5 of 5
  1. #1
    QuietPenguin is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    12

    Making a query to change the default value of a field

    I'm currently working on a database where the user will regularly be entering a bunch of data for each a given day. This work is often done in advance, so I would like to create a query (which I can then use a button to run on my form) that will change the default value of the date field so that it does not regularly need to entered.



    I understand that I can use Date()+1 to automatically have it be tomorrow's date at all times, but as data will often be entered for other days besides just tomorrow I would like to make it a query so that the user can easily change the default value of the field.

    Can this be done?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    the query does not change table default value.
    the query can hard code the value DATE() but not allow other dates to go into the field,
    so
    use a form.
    the field can be set to default = Date(), and if needed the user can change it to another date.
    And the box has a date picker to easily just click and pick date in calendar.

  3. #3
    QuietPenguin is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    12
    Quote Originally Posted by ranman256 View Post
    the query does not change table default value.
    the query can hard code the value DATE() but not allow other dates to go into the field,
    so
    use a form.
    the field can be set to default = Date(), and if needed the user can change it to another date.
    And the box has a date picker to easily just click and pick date in calendar.
    The field is currently set to Date(), but as the form will be used to enter data for a particular day hundreds of times any shortcuts will greatly reduce the amount of time it takes.

    The database is used to keep track of auction data, and a weeks' worth of auctions are often entered at once, with hundreds of auctions each day. I understand that I could simply go behind the scenes of the database and change Date() to Date()+1 or Date()+2, but this is not something I want the user doing. As such I'm searching for a way to create a button to my form that will alter the default value of the field so that the user need not enter the same thing hundreds of times.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    As ranman256, use a FORM. On the form you will have a text box with the date. (don't name it "Date" - use something like "AuctionDate")
    The query can reference the date textbox and use it in the update/append query.
    No need to try and set the default value.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

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

Similar Threads

  1. Replies: 4
    Last Post: 05-14-2018, 06:05 PM
  2. Replies: 20
    Last Post: 04-29-2016, 04:39 PM
  3. Replies: 7
    Last Post: 04-25-2016, 02:13 AM
  4. how to making rows look as default?
    By alex_raju in forum Access
    Replies: 1
    Last Post: 07-27-2011, 01:37 PM
  5. Making a new field in a query
    By mslieder in forum Queries
    Replies: 3
    Last Post: 05-14-2008, 11:44 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