Results 1 to 5 of 5
  1. #1
    Ant_Snell is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2021
    Location
    UK
    Posts
    124

    Hiding or making visible certain fields within a continuous sub form.

    I have an employee form with an absence details continuous sub form. The absence sub form includes an absent type combo with options like holiday, sickness, TOIL etc. and also Sickness Reason Level 1 combo & Sickness Reason Level 2 cascading combo fields along with other various fields like start date, end date and employee ID fields.
    I would like to make the Sickness Reason fields only visible when the absence type is Sickness.
    I have done this attaching the following code to the after update property of the absence type combo field:


    Click image for larger version. 

Name:	Absence.JPG 
Views:	12 
Size:	83.2 KB 
ID:	47640
    Private Sub Emp_Absence_Type_AfterUpdate()
    If Emp_Absence_Type = "Sickness" Then
    SickReason1Combo.Visible = True
    SickReason2Combo.Visible = True
    Else
    SickReason1Combo.Visible = False
    SickReason2Combo.Visible = False
    End If
    End Sub

    This works fine however it affects the full record set of the continuous form rather than just the affected record e.g. even if say “holiday” is selected on a different record it makes the sickness reason fields visible or vice versa if “holiday” on the current record is selected it hides the sickness reason on other records even if the reason is sickness.
    How can I show the sickness reason fields only on the current record without affecting other records in the sub form?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    That how continuous form works.
    so either use a single record form to hide it,
    or
    dont hide it. If they’re not sick, then the box is blank.

  3. #3
    Ant_Snell is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2021
    Location
    UK
    Posts
    124
    Ranman256, OK Thanks, it looks like its back to the drawing board for me then re design.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    Ant_Snell is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2021
    Location
    UK
    Posts
    124
    Good idea!, I think that should do it (thinking outside the box!) Thanks

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

Similar Threads

  1. Replies: 4
    Last Post: 12-17-2017, 07:09 PM
  2. Replies: 5
    Last Post: 08-14-2017, 02:19 AM
  3. How to condition Making Fields Visible in a Report
    By Juan1313 in forum Programming
    Replies: 2
    Last Post: 06-30-2017, 05:13 AM
  4. Replies: 16
    Last Post: 03-26-2015, 08:35 PM
  5. Hiding a new record in a continuous form
    By system243trd in forum Forms
    Replies: 3
    Last Post: 12-03-2011, 01:04 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