Results 1 to 4 of 4
  1. #1
    NicoCaldo's Avatar
    NicoCaldo is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Location
    Vicenza
    Posts
    2

    Automatic flag when fields are filled

    Hi,


    I'm setting up a database for my small activity and I would like to know if it was possible to create a field that automatically update itself with "yes/now" or check/unchecked if I fill specific fields of a table, or if it's simple, if I fills all the field of a table.
    maybe is super easy but I'm new to Access
    thanks to everyone will answer

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    You wouldn't normally store such a flag, simply calculate if the required fields have been completed.
    If someone deleted a value anywhere in your system you would have to trap that event and then reset the flag.
    As you can imagine that isn't very simple.

    If a value really is mandatory then make it a required field in your table design.
    You might be able to do it with a calculated table field, but I personally wouldn't recommend going down that route.

  3. #3
    NicoCaldo's Avatar
    NicoCaldo is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Location
    Vicenza
    Posts
    2
    I don't want to make the field required because I would like to create item also if this field aren't filled. I need this "filled/u unfilled flag" because I'll fill this field in different moment but I want it all saved and I want to know what it miss and what it's ok.

    the element created will never be deleted and, this table will be used only by me.

    thanks for your help anyway

  4. #4
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    Okay - The flag will only tell you something is missing though, not what is missing.

    If you insist on this the you would have to do it on a form, on the before update event of the form.
    The simple code would be something like
    Code:
    Dim bFieldsComplete as Boolean
    
    If Len(Field1 & "") < 1 OR Len(Field2 & "") < 1 OR Len(Field3 & "") < 1 OR Len(Field3 & "") ...etc etc THEN  bFieldsComplete  = False
    
    Me.YourCheckField = bFieldsComplete
    The more elegant way would be to loop around all the required field controls and check them based on a control tag being set to "Check" or similar.
    That way you would only need to add a tag to any additional controls you added.

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

Similar Threads

  1. Replies: 8
    Last Post: 08-02-2012, 02:53 PM
  2. fields automatically filled in a new record
    By fabiobarreto10 in forum Forms
    Replies: 9
    Last Post: 04-09-2012, 05:18 PM
  3. How do I see only fields that are filled?
    By fabiobarreto10 in forum Forms
    Replies: 56
    Last Post: 01-01-2012, 09:51 PM
  4. Replies: 5
    Last Post: 07-19-2011, 11:56 AM
  5. query with fields that cannot be filled in
    By durstlaw in forum Queries
    Replies: 3
    Last Post: 07-23-2010, 12:03 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