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
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.
I have tried searching a few threads, but can't get the answer or perhaps i'm tired. Anyway I have a YES/NO field and a command button. I want the button to be visible only if the yes field has been selected. No = invisible button.
I was able to use coding for making controls visible or not in the attached database.
I have a main form with a tab control that has 3 tabs with subforms in them.
What I am not able to do is in the Tab Control I want the 3rd tab to be invisible and on the second tab where it says “May we go through the questions now?”, I have a check box. When that check box is checked I want the 3rd tab to become visible.
I am having problems figuring out this code to reference the Tab Control Page.
My question is how can I make data in a form visible or invisible just by a button. In other words, if I have a group of buttons, based on the button selected I would want certain data to appear.
I know that this is possible, I have seen it done but just cannot find out how to do it or what this is called to look it up in Helps.
I've accomplished some simpler things like hiding fields based on the data in another field but nothing very complex. To the point: I have a report that shows data in both rows and columns, the report has a 7 columns, 3 of which could or could not contain data other than zero, in which case the column is not displayed. The problem I have is that it could be any of those three at any given time depending on what data is available for that report and what the user wants to see. Basically, if a given company has no data regarding column "A", then column A is hidden, but the main grouping is done through rows so all companies contain at least 0 for all columns (what I did is that, if a field sums the whole column returns 0, then the column is not visible). What I need to get working is the second part of this, have the columns rearrange themselves depending on which column is hidden (it could be that all 3 are hidden). How could I make this work? (btw, autoshrink is not usefull for this since it only shrinks vertically, not horizontally).
I run a merge process from VBA code to create word documents. I would like to add 2 word tables to a document and only show them based on some parameter or mergefield in the data.
Can a table be identified? Like Table 1. And can it be made invisible?
My company has a new database that we will use to track PTO (paid time off/vacation), including the submission/approval process. Not everyone should have access to the approval dashboard as that should be restricted to only managers. Everyone will have the same basic form so that they can see their PTO history, hours remaining to be used, etc.
What I want to do is have a button on the form that is visible only if the person is a manager. The button will open the PTO approval form. How can I make a button visible/invisible based on user access levels?
I know there have been a good number of questions about visibility in forms already but I couldn't find a solution to my problem (or maybe I just didn't get it).
Basically, I have a tabular form (more than one record displayed at once) and one the field is of the Yes/No type. For each record, I'd like to have a text box that displays 'pending', set as visible if the field value is 'Yes' and set as invisible if the field value is 'No'. The table is as follows: id : auto-number Flag: Yes/No [Yes]
If I use the following code on the Flag button: Private Sub Flag_AfterUpdate() Me.pending2.Visible = Me.Flag.Value End Sub
all the 'pending' text boxes appear and disappear together (instead of just the relevant one). I thought of using another text box, with the same data source ('Flag') but which would set itself to visible or invisible wrt to its own value but I couldn't find a way to do it.
Any suggestions ? Thanks in advance ! and many thanks already for the forum and the contributions - it's been extremely helpful, esp. for a beginner.
I am trying to improve my code by making it more readible. The following code works, but it is certainly not the most efficient way. I`m trying to write a loop to make certain elements in an Access report visible/invisible, but I can`t address the visibility property of these items while iterating over i.
I have a form which I use for call logging. I have created a subform which, when a client reference number is selected from a combo box in the main form, the client details appear (address, telephone number blah). It works fine but for purely aesthetic reasons, I want to make this subform invisible and create text fields in the main form bound to the text fields in the subform.
This I know how to do...
...making the subform invisible I do not!
The reason I want to do this is because I can't get the subform to look "nice" on the main form...with bound text fields on the main form I would be able to line them up nicely with existing text fields...
Hope someone can help or at least suggest a better alternative!
I have a subform (in form view) in a form that is used for data entry. When I open the form the subform is blank except for the navigation controls. The navigation controls are disabled though. If I switch to datasheet view I will see the column headers but there won't be any place to type data (no white boxes). This doesn't happen if my master and child fields aren't set up, but obviously that will show the wrong data and create other kinds of entry problems. Right now the tables are empty so that could be part of the problem, but I shouldn't have to manually enter a record so my form will look right.
I have two option buttons, 1_optn and 2_optn. I have two subforms, 1_frm and 2_frm.
When clicking the little round dot (the option button) for 1_optn, I want the subform 1_frm to become visible. Likewise, when clicking 2_optn, I want the subform 2_frm to become visible. In the properties panel, both forms visibility is set to No.
I have tried creating a Macro and the best I've gotten is using the OpenForm function but that opens up the forms in a new window. I'd set the Macro to the OnClick event for a combo box (as I couldn't get the option button to work) so when "1" is clicked, the form would pop up. But they have to be in the same form. No pop ups. It also has to be an option button, not a combo box or list box.It also has to be a Macro. No Event Procedure coding unfortunately.
I'm trying to get some labels and eventually text boxes to become visible on an input of a qty in a text box, but I can't get my syntax right.Here's what I have so far.
Private Sub More_qty_AfterUpdate() Dim count As Integer Dim pumplbl As String For count = 1 To [More qty].Value pumplbl = "pumplbl" & count pumplbl.Visible = True
Hi all... and thanks for your help to this very frustrated moderate Access user. I have been using an example for cascading combo boxes in a timesheet form, but I simply cannot get it to do what I need.
I have a table called "Entry", with a form called EntryForm based on it. That table has the follwing fields:
Name Date Hours Set* cboSet Subset* cboSubset Item* cboItem
The fields with asterisks are the ones I am trying to create cascading combos for. I have a table called "Sets" which has the same fieldnames in it, which I am trying to use as the sources for these fields. The form has "cbo" in front of the names. I have attached my code in a document.
It looks like all this does is act like an Excel autofilter. Can someone help me with the sourcing for these fields and how I get the Entry table to populate as I make entries. All my code does is push me to edit the Sets table records.
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.
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.
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
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 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!