Results 1 to 7 of 7
  1. #1
    Kalix is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2015
    Posts
    4

    Red face I want to be able to click a button to change a field from "not completed" to "completed"

    Hi!
    I am using Access 2013.



    My database has 30 fields - First Name, Last Name and one for each individual homework page ("B1page 1" "B1page 2" etc).
    All of the fields are text boxes.
    Each homework field has a default value of "not completed".

    On my current form, I manually change each text box to "completed" when the student is finished with each page. (This is very inefficient and time consuming).
    Each week, I post a report on my website where the students can see their homework status whenever they need to.

    I would prefer to click a button to change the status of each individual field from "not completed" to "completed" .

    Is there a way to do this?

    Please be gentle... as you can tell, I really don't know much about this. Thank you so much!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This appears to be a non-normalized data structure.

    Code would be required in button Click event that sets value of field. Or change the field to Yes/No type and all you have to do is click checkbox to change value.
    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
    Kalix is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2015
    Posts
    4
    Thank you, June7, for your reply. I realize that I am not an expert in this.

    Can someone please tell me what the code would be?
    Thank you again for your patience with my ignorance.
    Kalix

  4. #4
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Looks like you are treating Access as an advanced Excel. However they are two completely different products with completely different ways of managing data.

    learn about normalisation - because your data is not normalised, instead of one bit of code, you will need slight variations of the same code for each 'completed' box

    rather than having a button, I would put the following code on the double click event of each 'completed' textbox


    Private Sub B1page_1_DblClick(Cancel As Integer)

    If [B1page 1]="not completed" then
    [B1page 1]="completed"
    else
    [B1page 1]="not completed"
    end if

    End Sub

    change [B1page 1] for each control

    this saves having 30 or whatever buttons on your form (but not 30 bits of near identical code) and enables you to toggle between the two values

    But really, you should google 'normalisation' and understand what you are doing wrong and why

  5. #5
    Kalix is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2015
    Posts
    4
    Thank you thank you thank you!
    I understand that I am not using Access correctly. I will try your suggestion. Someday, i will learn to use Access correctly.... I promise
    Kalix

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I understand that I am not using Access correctly.
    Why someday?
    Work through this tutorial in 30-45 minutes and you'll have a better understanding of database and table design.
    There is a solution included. Do the work and you will understand some concepts that can be applied with any database.
    Normalization
    Good luck.

  7. #7
    Kalix is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2015
    Posts
    4
    Thank you. I am off to a 12-hour work day. Someday, when I don't work 12 hour days 6 days a week, I will definitely work through the tutorial. I'm saving it to do just that. Thank you sooooooooooooooooooooooo much!!!

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

Similar Threads

  1. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  2. Replies: 30
    Last Post: 09-27-2013, 01:34 PM
  3. Filter out "Completed" items from subform
    By dargo72 in forum Forms
    Replies: 2
    Last Post: 11-28-2012, 10:41 AM
  4. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  5. Replies: 0
    Last Post: 01-11-2012, 12:34 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