Results 1 to 5 of 5
  1. #1
    gprzytula is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2022
    Posts
    13

    field is based on an expression

    in a library access app, when they return books, I run a query and add a field based on date() when the book is returned


    It could happen that we register the return tomorrow and so can not update the datasheet
    is there any possibility to return current date and have the possibility to modify it if needed
    thanks for all help
    best regards, Guy

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,787
    Perhaps use parameter prompt in query criteria for date field [Enter Return Date]. However, user must provide a valid date in the correct format otherwise errors can occur, so easy but not ideal. If you are entering/editing records via forms as you should be, then the date field on your form could show a calendar when user clicks in it - then choose the date. The query updates the table date field to the date chosen.
    Others might chime in with more ideas also.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    gprzytula is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2022
    Posts
    13
    yes if I do
    select col1, [IN] from ... and IN is a date type in table and empty = we can modify using the calendar, but manual intervention is to be done

    I wanted the empty field from table, already be filled by current date and be modifiable if needed

    if I do
    select col1,date() as [IN] current date is displayed, but I can not modify if I want to register the movement to a different date


    Best Regards, Guy

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    If that would be a new record you could set the default value to Date() (in the table). But looks like you are editing the records in a query which is (usually) not recommended. You cannot have what you want unless you use some sort of temporary table. So the best way would be to use a form (in datasheet view if you like that) using the your first example in post # 3 as the record source and add a textbox in the header to select the IN date along with a button to run the update.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    Note that IN is a reserved word and should not be used for a field name. It is a sql keyword and may cause strange errors

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

Similar Threads

  1. Replies: 2
    Last Post: 03-11-2019, 01:26 PM
  2. Can't Edit When Data Based On Expression
    By shylock in forum Access
    Replies: 3
    Last Post: 10-09-2018, 06:50 PM
  3. Replies: 2
    Last Post: 11-16-2017, 03:33 AM
  4. Replies: 2
    Last Post: 05-30-2012, 09:09 AM
  5. Replies: 1
    Last Post: 01-29-2012, 01:06 PM

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