Results 1 to 3 of 3
  1. #1
    hoff is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    7

    Need checkboxes to enable subforms

    Hey,



    I've been working on a big database and now that I've figured out the relationship/form structure I need to add some extra functionality.

    The attached pic shows you the process I have for entering patient data in my database..

    Note: addition of ~20 sub subforms (assessments) and formatting of assessments is going to change once I have a functional structure

    Click image for larger version. 

Name:	form.jpg 
Views:	11 
Size:	117.9 KB 
ID:	7825

    Subject ID/Patient Demographics is the main form. Date index is a subform connected through the global ID (GLID) via one to many. Each GLID in Date index can have many assessment dates, and this combo (GLID + date) is represented as a unique Event ID. Every assessment is then connected through Event ID via one to one. These assessments are sub subforms, ie. subforms in the Date index form.

    I only want to allow entry access for certain assessments if intended, so I'll use checkboxes. I have basic functionality, but it doesn't save what I do when navigating from record to record


    My current code is as follows:

    Private Sub IQ_check_AfterUpdate()
    If Me.[IQ_check] Then
    Me.[IQ].Enabled = -1
    Else
    Me.[IQ].Enabled = 0
    End If

    End Sub

    Private Sub IQ_check_BeforeUpdate(Cancel As Integer)
    If Me.[IQ_check] Then
    Me.[IQ].Enabled = -1
    Else
    Me.[IQ].Enabled = 0
    End If

    End Sub

    Any help or alternate options would be appreciated!!

  2. #2
    Jester0001 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    69
    Just a quick thought...

    but it doesn't save what I do when navigating from record to record
    Have you tried the Me.Dirty property?

    Code:
    'To force save the record data on the main form
        If Me.Dirty Then Me.Dirty = False

  3. #3
    hoff is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    7
    K I think I got it..

    for one, I created yes/no checkbox fields in my DATE_index table, so values are stored there. Then I pasted the same If statement into my form's 'on current' event.

    Next question...

    I figured out that I can add the identical code with visible replacing enabled. This is nice because the form and tab it sits in only shows up when I click the box..

    My question is, should I keep the Enabled code in each checkbox event with visible to be safe, or is visible sufficient to block data entry?

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

Similar Threads

  1. Enable Field off Text Box
    By SpdRacerX in forum Forms
    Replies: 5
    Last Post: 03-13-2012, 01:48 PM
  2. IF Statement for checkboxes
    By Ran in forum SQL Server
    Replies: 16
    Last Post: 02-09-2012, 06:12 PM
  3. Checkboxes ?
    By Trojnfn in forum Access
    Replies: 3
    Last Post: 09-30-2011, 01:52 PM
  4. Enable a check box after printing
    By nukephysicist in forum Programming
    Replies: 1
    Last Post: 05-26-2011, 01:40 PM
  5. could not enable autocorrect
    By easbrandel in forum Access
    Replies: 0
    Last Post: 04-15-2010, 07:10 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