Solved

Problem with fields being visible in Continuous Form

Posted on 2011-09-18
12
70 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
 
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

920 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

15 Experts available now in Live!

Get 1:1 Help Now