Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with fields being visible in Continuous Form

Posted on 2011-09-18
12
Medium Priority
?
127 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 800 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 800 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

705 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