Solved

Problem with fields being visible in Continuous Form

Posted on 2011-09-18
12
82 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
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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

770 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