Solved

Problem with fields being visible in Continuous Form

Posted on 2011-09-18
12
54 Views
Last Modified: 2016-06-17
Great Day! I have a subform that allows the user to identify the type of service that is being performed on a vehicle. While the technician is performing the work, he may discover other items that need to be addressed. If so, he will check a box that says "Item recommended by technician," and I would like to make visible at that time a field that allows the user to place the number of days before a reminder notice is sent about the recommended work and a date field that allows the user to place the date that the reminder was sent.

When I click the "Item recommended by technician" field, I only want the two fields to become visible for that record only; however, it has become visible for all of the records. I placed the [field name].visible = true (or false as appropriate) in the "Item Recommended by technician" click event and the form's On Current event.

I would like some help on how to just make the fields visible in the record where a service item was recommended by the technician. I have enclosed an image of the form, and you will note the fields under the "Repair List" subform.

Thanks in advance.

r/David
Independent-Auto---Screenshot---.png
0
Comment
Question by:yddadsjd95
  • 3
  • 3
  • 3
12 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 200 total points
Comment Utility
There is no way to do what you ask.

Properties of controls in a continuous form are always the same for all records with the following exception.

A possible workaround is to format the textboxes so that they are initially designed to be  the same colour as the form background (thereby making then 'invisible').
Then use conditional formatting so that if the checkbox is checked , the formatting is changed so that they become 'visible'.
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 200 total points
Comment Utility
Conditional formatting also allows you to set the enabled property of controls.  In conjunction with Pete's suggestion, conditionally formatting the enabled property would prevent users from accidentally editing hidden controls.
0
 

Author Comment

by:yddadsjd95
Comment Utility
Thank you peter57r, I am working with your suggestion, but am not getting the desired results yet. I set the back color and the fore color to the same color as the detail back color and all of the identified fields were no longer visible. Then if "Item Recommended by Technician" is checked, then I run the enclosed code. I suspect that I need to also place this code in the form's On Current event as well. The fields are still not visible. I've tried running the code with the fields visible property being set to False and True in the Property Sheet.

The color "FFFFFF' is the color used for all of the other controls that are visible in the form.

Also, thanks mbizup, your suggestion is noted and I will incorporate it.

r/David
Private Sub Recommended_Click()

   If Recommended Then
'        Me.ServiceItem.SetFocus
'        Me.lblRemindDays.Visible = True
'        Me.RemindInDays.Visible = True
'        Me.lblRemindDays2.Visible = True
 '       Me.lblDateSent.Visible = True
 '       Me.RemindSentDate.Visible = True
        Me.lblRemindDays.ForeColor = 0
        Me.lblRemindDays.BorderColor = FFFFFF
        Me.RemindInDays.ForeColor = FFFFFF
        Me.lblRemindDays2.ForeColor = FFFFFF
        Me.lblDateSent.ForeColor = FFFFFF
        Me.RemindSentDate.ForeColor = 0
        Me.RemindInDays.BorderStyle = solid
    Else
  '      Me.ServiceItem.SetFocus
  '      Me.lblRemindDays.Visible = False
  '      Me.RemindInDays.Visible = False
  '      Me.lblRemindDays2.Visible = False
  '      Me.lblDateSent.Visible = False
  '      Me.RemindSentDate.Visible = False
    End If


End Sub

Open in new window

0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
No points for this, please.  The conditional formatting Pete is talking about requires no code. It is a formatting options of the control.  I don't have a database in front of me, but I think you can right click the control, select formatting and then conditional formatting.  It's also available from the access 2003 toolbar or the ribbon in later versions.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Conditional formatting behaves differently from the code you posted, and should work for you with distinct formatting for different records.
0
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
You cannot use code for this.
You must use the Conditional Formatting option on the format menu.
0
 

Author Comment

by:yddadsjd95
Comment Utility
Okay, I see how to make the conditional formatting change based on certain criteria; however, it does not appear to permit me to alter the formatting of one field based on the value of another. If the field "Recommend" is true (or 1), I want the labels and text boxes associated with this to be visible. this does not appear to permit this type of conditional formatting. Also, it does not appear to alter the font of a label, which is no problem, because I could change the labels to text boxes.

r/David
0
 
LVL 77

Expert Comment

by:peter57r
Comment Utility
You use the Expression Is option..

and do something like...

[otherfieldname] = 1
0
 

Author Comment

by:yddadsjd95
Comment Utility
It is not going as smoothly as I had hoped for, so I will have to put this to the side momentarily, but I will get back to it in the next few days.

Thanks,

David
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now