Solved

Problem with fields being visible in Continuous Form

Posted on 2011-09-18
12
120 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
12 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 200 total points
ID: 36556347
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
ID: 36556427
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
ID: 36556758
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 61

Expert Comment

by:mbizup
ID: 36556969
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
 
LVL 61

Expert Comment

by:mbizup
ID: 36556986
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
ID: 36557126
You cannot use code for this.
You must use the Conditional Formatting option on the format menu.
0
 

Author Comment

by:yddadsjd95
ID: 36559171
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
ID: 36559221
You use the Expression Is option..

and do something like...

[otherfieldname] = 1
0
 

Author Comment

by:yddadsjd95
ID: 36559994
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

622 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