Subform Visible Property

Aug 5, 2005

I have a form with a subform on it, if the user clicks a control on the subform I want to set the subforms visible property to = False.

I have tried Me!Subform.visible=False and Form!Subform.Visible=False but neither are working, I think i have to set focus back to the main form before I can set the visible property of the subform.

View Replies


ADVERTISEMENT

Set Form's Visible Property To False

Feb 17, 2005

This seems really straight forward to me. I have 3 forms - FormA, FormB and FormC. When I open FormA the user inputs some information, when they tab to the last field, FormB opens (which I want to be invisible) and Form C opens.

I've tried putting this coding on the Open event of FormB:
Me.Visible = False

I've also tried putting this code on the Open event of FormC
Forms!FormB.Visible= False

Neither work. My form (FormB) still displays when eithr event occurs.

Any suggestions?

Cindy

View 6 Replies View Related

Resetting The Visible Property On Fields

Mar 2, 2005

I have a couple of fields on my form (Resolution Type, Date Closed) that I want to display only if the Status field has Closed as its selection for each record. I initially set the Visible parameter of both the type and closed fields to False and I reset them to visible by checking for open/closed with an afterupdate event. This works great for the first record but...subsequent entries display those 2, regardless.

I know just enough regarding events to struggle my way through on some things but more advanced field, record level and form level events are beyond my experience level.

Can anybody offer any advice on how to get those two fields to toggle visible/invisible when scrolling through the records?

With that said, does anyone have a link to a post/website referencing this subject?

Thanks in advance,

Mike

View 1 Replies View Related

Label Visible Property Problem

Mar 30, 2005

Hi
I have a form where the processing is a little slow and I want to advise the user that something is actually happening!
So I put a label on the form (lblWait) with a suitable message. The visible property is set to Yes.
On the form open event I put
Me.lblWait.visible = False
This makes the label invisible as expected. On the code behind the run button I started it off like this
Set cnn = CurrentProject.Connection
Set rst = New ADODB.Recordset

' Reveal wait message
Me.lblWait.Visible = True

' Delete any extant records in tblTmpReportDates
cnn.Execute "DELETE * FROM tblTmpReportDates"

However, my wait message stays invisible throughout the whole process. All the other processing goes fine.
I sense I am either using the wrong procedure to put up a wait message but shouldn't this work?
Any words of wisdom would be most appreciated, especially if they solve the problem!!
Thanks in advance and best wishes

View 2 Replies View Related

Visible Property Coding Problem

Jun 18, 2005

I have a form that I use to both add new records and edit existing ones. I do this thru a combobox and two command buttons. One button opens form in add records mode with combobox visible property set to no. The other button sets the visible property to true. I am getting an error message that "the field combo60 can not be found" Here is my code:
Private Sub Label63_Click()
DoCmd.OpenForm "frm_Client Information"
Me![Combo60].Visible = True

End Sub
The name of the combox is right. Can anyone help?

View 2 Replies View Related

Updating Label Visible Property Not Working

Dec 7, 2006

i am running a query that takes few seconds to run but during that time i want my label to say "please wait'' so when the form loads i have it as:

lblstatus.visible=false

and when the user click on generate report that runs teh query i have as:

button_click starts
lblStatus.visible=true
button_click ends

but guess what, this doesnt work!! looks like the screen is not updated until the button_click processes, if i add a msgbox() after lblstatus.visible=true it shows but after the msgbox which i dont want. anyone know why?

View 1 Replies View Related

Want Check Box On Switchboard Form To Set A Text Box's Visible Property In A Report

Sep 23, 2004

On my switchboard form, I have a check box which the user can check to make a text box (which appears in several different reports) visible and uncheck to make it invisible. The text box in the reports has the same name on all of them.

I am having trouble making this work.

I can think of two solutions, but haven't had success with either yet.

1. I could simply change the visible property of the report(s) control from the form. This works if the report is open, but throws an error if the report is not open.

Code:Public Sub showNumOrgsInReportCB_AfterUpdate()If Me!showNumOrgsInReportCB.Value = 0 ThenReports![publishZipR]![numOrgsF].Visible = FalseElseReports![publishZipR]![numOrgsF].Visible = TrueEnd IfEnd Sub

Is there a property or function I can use to test whether the report is open before I set the text box visibility?


2. Alternatively, a less elegant solution would be to run an event procedure to close all open reports. This would eliminate that issue, but I haven't gotten the code to work yet:

Code:Public Sub showNumOrgsInReportCB_AfterUpdate() Dim rpt As Report ' Enumerate Reports collection.For Each rpt In ReportsDoCmd.Close rpt.nameNext rptEnd Sub

This line:
DoCmd.Close rpt.name
throws a Run-time Error '13', Type mismatch.

How do I fix that?


I'm open to better ideas!

Thanks

View 2 Replies View Related

Reports :: Changing Visible Property Of Blank Image Fields In A Report

Dec 8, 2014

My student is doing a project on question paper generation in which he selects questions from each lesson needed and also some of these questions have images associated with them. So, if these questions are selected, the image control in the report displays it.

If there is no image, the space for the control is left in tact. I tried changing the visible property for the image control in the Detail_Format event procedure. But this code is not reached at all and the space is still left. I am not storing the image directly in the field but its path in a text field.

I want that the space occupied by the image control removed. I tried the suppression thing but obviously it did not work.

View 6 Replies View Related

Reports :: Change Specific Subreport Visible Property Base Of A Select

May 6, 2015

I have stumbled across an issue in my report involving the Report.SourceObject property. The section of the report contains a subreport that needs to change dynamically to display the report that relates to the corresponding test. When trying to change the subreports.Sourceobject property I get the error Run-time error 2191: You cant set the Source Object Property in the print preview or after printing has started.This is very clear to me what the limitation is, however I was wondering if there was some way around this.

I have currently tried creating multiple subreports that are stacked on each other with visible property set to false. Then I change the specific subreport visible property base of a select. This worked, but was extremely hard on the machine and printer as there is about 15 different possible subreports.

Secondly I have tried exporting it to RTF and just manually copying and pasting the tables. The down side with this is all the formatting and work I have put into the report as a whole goes out the window so if possible would like to avoid this situation as well.

View 8 Replies View Related

Make Field On Subform Not Visible

Mar 17, 2005

I have a form with a subform. I would like to make a field on the subform not visible if a field on the primary field is null. Can anyone help? Thanks.

View 1 Replies View Related

ARGH !! Need Help On Visible/Invisible Subform

May 11, 2006

I am trying to make a subform appear when a particular entry is selected from a list box. I did a test... no problem. In my real database... well, you know. Here's my code:

----

On my main form property:

Private Sub Form_Open(Cancel As Integer)

DoCmd.Maximize
DoCmd.GoToRecord , , acNewRec

If Me![ProjectSubType] = "Commercial Chest" Then
Me![CommercialChestsSubForm].Visible = True
Else
Me![CommercialChestsSubForm].Visible = False
End If

End Sub

----
On my list box property:

Private Sub ProjectSubType_AfterUpdate()

If Me![ProjectSubType] = "Commercial Chest" Then
Me![CommercialChestsSubForm].Visible = True
Else
Me![CommercialChestsSubForm].Visible = False
End If

End Sub

----


Any help is GREATLY APPRECIATED.

Tom

View 2 Replies View Related

Label Box Visible If Subform Value Is Null

Nov 1, 2004

Can i have a label appear if a value in my subform is null.

i have a report called "ModelFinalReport"

which has a subform called "ModelFinal"

And in that subform a textbox called "VAT"

i also have a label on my main form that i want to appear if the text box "VAT" returns a null value. but be invisible if "VAT" returns a true value.

how should this be written please.

Cheers

Andy

View 2 Replies View Related

Modules & VBA :: How To Check If A Subform Is Visible

Sep 25, 2013

I'm trying to check if a subform is visable. The following code is just test code so I can get a result. I keep getting an error on the .IsVisible section.

If datTimePlus15 <= datCurTime And [frmBarstockAreaSubForm].IsVisible Then
MsgBox datTimePlus15 & " " & datCurTime
datTimePlus15 = DateAdd("n", 1, Now)
End If

View 2 Replies View Related

Macro For Visible Field In Subform

Sep 10, 2012

I have created a form with a subform.

When opening the main form I would like to create a macro that is able to set the property visible/not visible for a certain field if a certain condition on another field is satisfied. I Have Office 2010 and with the macro editor I'm not able to make it work. Need writing the text as in the macro editor?

Here below the example:

Main form name: FORM_1
Subform name: SUBFORM_2
Subform field: FIELD_ABC
Subform field: FIELD_123
Subform field: FIELD_CHECK

Opening the form FORM_1, the macro must show the field FIELD_ABC and hide the field FIELD_123 only if FIELD_CHECK is equal to "TEXT OK" ...and the macro must hide the field FIELD_ABC and show the field FIELD_123 only if the field FIELD_CHECK is equal to "TEXT WRONG".

I would like to use the same macro on a report.

View 7 Replies View Related

Forms :: How To Keep Subform Filter Property From Turning On

Dec 23, 2013

This doesn't happen on all my other Frm/subfrms that I have. Only this one and I can't figure out why.

I have a main form with a datasheet subform and a detail subform on it. The detail subform works fine until I filter on the datasheet.

Both forms use the same view.

But, when I filter on the datasheet form, the filter on the bottom of the 2nd subform turns on and I can't unfilter it. I can't figure out what it's trying to filter. If I can figure out how this is happening, I can prevent it and then the subform will just reflect the record selected from the datasheet. This doesn't happen with any other datasheet/detail form that I have.

View 1 Replies View Related

Modules & VBA :: Call Event From Subform Using Tag Property?

Jul 11, 2013

I am starting to explore VBA and Modules. I recently found a relativly simple way to add an Audit Log to a database without adding two tables for each table as outlined by Allen Browne.

I used a set of code from fontstuff.com and it works great, except when using a sub form. I belive that it is most likely because the use of the Tag property looks at the subform as a control but it holds no value. I am thinking the VBA needs to be altered or the BeforeUpdate command need to specify what form to look in.

The Before Update code is

Code:

Public Sub Form_BeforeUpdate(Cancel As Integer)

Code:
If Me.NewRecord Then
Call AuditChanges("SubForm_ID", "NEW")
Else
Call AuditChanges("SubForm_ID", "EDIT")
End If
End Sub

AuditChanges is the Module Event name and CustomerID is the unique identifer for a Subform.

View 1 Replies View Related

Problem Making A Label Visible In A Subform! URGENT - Please HELP!!!

Nov 16, 2005

Hi guys,

I have a form (frmMain) which contains 3 subforms and they are being set to visible at different stages of application run (depending on the options selected).

In subfrm_Main_options i have 3 buttons, clicking on 'Job Review' will make the subfrm_Search visible. In the subfrm_Search i have 2 labels, 'View Jobs' and 'View Report' and I only want the 'View Jobs' to be visible!

I have tried setting the visible property of this label to False in the subfrm_Main_Options but its giving me an error (saying the form subfrm_Search is closed or does not exist in the database!). I also tried using a Global Variable (ViewJobs - declared in module mdlPublicVars) and set it to True once the 'Job Review' is clicked in the subfrm_Main_Options form, and then look at this in subfrm_Search and then display the correct label. However after trying to put this code in various events such as, On Open, On Got Focous, On Activation, ... i didnt get the result i wanted!

Can any1 please help me out with this. I would be really grateful!

PS. The buttons appearing on the form are placed on the frmMain, I did that to see if it appears on the main form but they must be in subfrm_Search!

The database is attached!

Thanks, Maisam

View 1 Replies View Related

Forms :: Subform Visible / Invisible Based On Control

Jun 18, 2015

I need to have a subform that shows up smack dab in the middle of my main screen when visible - which is what I want - but only based on a specific value of a control on the main form. Specifically, if a control's value is "See Spreadsheet", I want the subform visible front and center as it contains the link to the server location for that specific record. If the control's value is not "See Spreadsheet", I want the form to be invisible.

My code:

If Me.BudgetsFacultyAccountNumber = "SEE SPREADSHEET" Then
Me.frmMsgBoxUpdateSpreadsheet.Form.Visible = True
Me.BudgetsFacultyServerLocation.Visible = True
Else:
Me.frmMsgBoxUpdateSpreadsheet.Form.Visible = False
Me.BudgetsFacultyServerLocation.Visible = False
End If

The red lines result in an MS VBA error: "Compile error: Method or data member not found."

I've tried referencing that subform a hundred different ways, but I can't get it to work.

View 5 Replies View Related

Modules & VBA :: Change Default View Property Of Subform

Feb 26, 2014

I have a form with a subform where I want to select (via button) which format to open the form in. Opening the form is simple, DoCmd.OpenForm (FormName),acFormDS to open in datasheet, however, the subform opens in default view (single form). Can you programmatically set the property on the subform to change the Default View from Single Form to Datasheet and back?

View 3 Replies View Related

Modules & VBA :: Using Form Combo Box To Control Subform Button Visible Or Not?

Nov 24, 2013

How to use the combo box from the form to control subform button or textbox visible or not?

View 5 Replies View Related

Problem Making A Label Visible In Subform! Continue Of Previous Post! Please Help!

Nov 16, 2005

I sent a post earlier today about making a label visible in a subform! I am still working on it but still no progress!

I have a different scenario (its the same thing but trying to explain the method i'm working on):

I have one main form (frmMain) that contains 3 subforms, say subfrm1, subfrm2 and subfrm3. On Open only 1 is visible and 2 and 3 are invisible (however they are open and loaded).

By choosing an option on 1 subfrm2 becomes available! When choosing an option on subfrm1 a boolean called 'XXX' is set to true. Now i want one particular label to become visible in subfrm2 if 'XXX' is true! To do this i need to write a code to be executed when subfrm2 is appears on screen! The problem is this form is already open so how and on which event of subfrm2 can i write the code???

At the moment i'm trying to refresh subfrm2 (by using code in subfrm1) and I have placed my code on the On Load event of subfrm2. I thought this way the form will reload and the On Loand event will pick up the new value for boolean XXX and set the label to visible! Thats the idea anyway... here is the code i have in subfrm1:

XXX = True

Forms![frmMain].subfrm2.Form.Refresh

subfrm1.Visible = False

subfrm2.Visible = True

I'm not sure if refreshing the subform will result in On Load event to be executed! And i'm not even sure that the code for refreshing subfrm2 is correct. Can any1 help me with this?

I have attached the actual database on my previous post sent today, if you prefer to look at the whole thing and get a feel of the problem!

View 1 Replies View Related

Reports :: Image Visible On Sub-report When Choose Received Payment In Subform

Mar 4, 2014

I have a database that I use for keeping track of clients and printing invoices using a form/sub-form and report/sub-report. I want an image to be visible on my sub-report when I choose Received Payment in my sub-form. Right now I have my image set to visible = no.

View 14 Replies View Related

Forms :: How To Make Column Width On A Subform Match Property Settings

Mar 19, 2015

I've set the column widths properly on the subform, but the down arrow on the list box is still outside of the selection area. It may have something to do with lookups or concatenations, but I'm not finding that so in what I can think of to trace down.

I exaggerated the width of the list box to show where the down arrow actually shows itself.

See the form "frm_Class_Skills_Update" in the attached database. I need it to be visible when the list box is about 1.25" more narrow.

View 2 Replies View Related

Forms :: Visible / Non-visible Combobox - Column Attribute?

Oct 17, 2013

I have a combobox on my form called TypeOfBusiness, with fields including Corporation, Education, Industry, Non-Profit. In order to make a second combobox called IndustryClassification appear when Industry is selected from the TypeOfBusiness combobox, I have used the following code:

Code:
Private Sub Form_Current()
If Me.TypeOfBusiness = "Industry" Then
Me.IndustryClassification.Visible = True
Else
Me.IndustryClassification.Visible = False

[Code] .....

It works just fine. However, when a user selects both, say, Industry and Education, the IndustryClassification combobox will not appear. What code I can use to ensure the IndustryClassification box will appear regardless if another box is checked in addition to Industry? I am wondering if it has to do with the Column attribute.

View 14 Replies View Related

Modules & VBA :: Make Controls Visible Or Not Visible?

Mar 24, 2015

I have a Main Form with a Sub-Form, the sub-form is base off a query. on the sub-form i have 8 controls, one of them is "Status' and "Process" and "Review" My Main Form have a Refresh command that refreshes the data in the sub-form.

What i am trying to do is make the "Process" Control only visible is "Status" is a certain status and "Review" visible if "Status" is something else. what i have done works correctly On Open. I run into and issue on the refresh command. I get Run-time error '2165' "You can't hide a control that has the focus"

Code:
If Forms!Main_Form.[Name subform]!Status = "Ready" Then
Forms!Main_Form.[Name subform]!Process.Visible = True
Forms!Main_Form.[Name subform]!Review.Visible = False
ElseIf Forms!Main_Form.[Name subform]!Status = "Reviewing" Then
Forms!Main_Form.[Name subform]!Review.Visible = True
Forms!Main_Form.[Name subform]!Process.Visible = False
End If

I have done similar with a main form and making sub-form visible or not based on a control on a main form and that has worked perfectly. I am not sure how the control is getting focus and cause the error.

View 4 Replies View Related

Visible.Enabled Remaining Visible!

Sep 12, 2004

I have a form with four subforms set up in a tabs on the form. In the subforms I have a copuple of command buttons which enable/make visible fields when they are clicked (see previous posts but for eg) - if a height and a weight are added in two separate boxes a calculation is done and then a command button pressed to make visible the (label) which shows the mass index the patient falls into. My problem is that the label is then retained so if I click out of the form and re-enter with a new patient then the height and weight boxes are clear but the label from the previous patient remains.

I tried to put the code
Private Sub Form_Load()
If PtWeight = Null And PtHeight = Null And Text60 = Null Then
Label106.Visible = False
Label101.Visible = False
Label177.Visible = False
Label122.Visible = False
Label123.Visible = False
End If
End Sub
in both the open and on load event of the main form (not the subform) but it doesn't help. Any ideas?

(When should code be put on the main form and when on the subform?)

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved