Results 1 to 5 of 5
  1. #1
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63

    change a field one time

    I am working on a project that logs temperature readings, all is working well except i need to put a block on a field named [1st reading] so that it can be changed one time then it is locked.



    The record is created as part of a batch append query with a number field that is blank for the default reading. It must be allowed to entered or changed one time.

    The Field Name is [1st Reading] on the form [log]
    The field is named [1st Reading] in the Table [Data]

    My thought is to create a field named [lock] on the table [Data] to control this

    My thinking is that when a user goes to change data in the form the [1st Reading] field it will trigger the "on dirty" event to look to see if the
    [lock] field is null. If it is it will allow the change and also do a "send value" command to enter "L". in the [lock] field of the table.

    The next attempt to enter data in the [1st Reading] Field the routine will see the "L" value and will not allow a change and will present a message saying "this field is locked for editing"

    How do I do this?
    i can see a simple if then and send value command but I dont know how to do the if [lock] is null allow value and send the "L" value
    or the if [lock] is not null send message.

    Is there a better way?

    FYI the allow additions and dont allow edits wont work because the field is pre-populated with a value populated with a value

  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,900
    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
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63
    ok a quick re thought....
    On the form I have a send value on change macro set up so that when a number is entered in the [reading] field the send value event sends the current date and time to a [time stamp] field.
    So really all I need to do is set a on focus event on the [reading] field to look to see if the [time Stamp] field is null. if it is then end, else Do something like display a message saying "locked"

    Would that work? how would I SQL that?

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Simply abandoning a prior thread with several responses will limit your chance at a solution. I doubt anyone will really want to get involved here when the possibility exists that you're still accepting responses elsewhere. Your post 12 isn't clear as to whom you're addressing. Maybe post 10, which provided the answer (albeit maybe not in a way you understood)?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63
    >>>> Thread Closed <<<
    >>> moved to Programming Forum <<
    Sorry about the duplicate

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: 1
    Last Post: 06-25-2016, 02:00 PM
  3. Replies: 3
    Last Post: 07-20-2012, 11:41 AM
  4. Replies: 5
    Last Post: 07-18-2011, 06:07 PM
  5. Run-time 339 when change to 2007
    By nivek in forum Access
    Replies: 1
    Last Post: 06-30-2010, 08:40 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