Modules & VBA :: Loop For Labels Invisible / Not Invisible
Nov 8, 2013
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
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 the following code. In the Else part of the code, after the wb.Activate line, what code can I place here that will assign wb.Name to the objExcelApp object ao that when the line .Visible = False kicks in, it will make the already opened MS Excel file invisible.
Code: Dim strExcelFile As String Dim wb As Workbook Set objExcelApp = GetObject(, "Excel.Application") If objExcelApp Is Nothing Then Set objExcelApp = CreateObject("Excel.Application") objExcelApp.Workbooks.Open FileName:=strExcelFile
I have a form (Form1) and a in it, I have 2 subforms datasheet (Subform1 and Subform2). I have ID, First Name, Last Name in each as headers.
I need to:
1) Find the subforms 2) Loop through the subforms and get all the labels 3) Change the captions
The reason for this is because I need to have the forms bilingual. I do have a function that will translate the caption (called TranslateThisWord). I just cant figure out a way to loop through the subforms and find all the labels.
I want to invisible some subform in tab, and there have some check box in the main form to controls which form is visible. ---------------------------------------------------------------------- Private Sub StudentInfo_Click()
If Not IsNull(Me.StudentInfo) Then Me.tabStudentInfo.visible = "Yes" Else Me.tabStudentInfo.visible = "No" End If
End Sub ---------------------------------------------------------------------- Did my code have anything wrong?
on a report, I'd like some sections to dissappear (a bunch of labels, text boxes etc...) if there isn't any data.
I have a text box with a fomula in it to return values. But if the value is null, nothing displays. This bit is OK. But I'd like the associated lable to dissappear as well. This is one of the many combinatios I've tried: Private Sub Report_Open(Cancel As Integer)
If txtboxpmpbalance.ControlSource = Null Then lblpmpbalance.Visible = False
End If End Sub
I get a run time error saying there's no value. I'm assuming its because there's a formula rather than a value in the control. I appreciate any ideas.
I have a simple database used for competition entries and scoring where I capture the entrants' details (and later their scores) in a single table. If an entrant returns to have another go I can either type in his details again or choose one of his earlier entries and issue a "duplicate" command (I have a button on the form to do this). This seems to work OK and a new record is created and I can see it in the underlying table and it looks OK. However despite restarts, refreshes and requeries none of my queries seem to be able to see a record created in this manner. Any suggestions?
Office XP with latest service pack3 update. Thanks Dennis
I belive I have done this before but I cant remember how!
I have a continuos form with two text boxes on it and a check box.
I am trying to say if text box1 = "1" then text box 2 is visible if text box 1 = 2 then text box 2 is invisible. I am doing this on a tick box (for other reasons) so my code looks like this:
If Me.Text1 = "1" Then Me.Text2.Visible = True End If If Me.Text1 = "2" Then Me.Text2.Visible = False End If
It works, kind of. The trouble is because its a continuous form all the Text2 boxes become visible or invisible depending rather than just the one record i'm working on. Is there a soloution to this?
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 could easily fix this problem (I hope) by deleting and recreating my form, but I'd really like to know what's going on.
I made a simple form that relates to a single table. No big deal. Somehow, through all of my editing and coding, whenever I open up the form all of the controls are empty. It acts as if the related table was empty. I know the table is not empty though. The only way I can get the form to display anything is if I select "Remove Filter/Sort". The odd thing is I can't find anything that would be filtering my form. This form has no code and the form properties don't show any filters. This odd behavior even occurs when I open the form from the database window and even when I reopen the database.
I heard of a script that runs before the database opens and it reads the user log-in ID (when you start windows) and, dependng on who you are, grants appropriate permissions. My brother told me they use that where he works. If anyone has a sample of that kind of database or knows what I'm talking about could you e-mail me? (PMs on this forum don't work for me) My e-mail address is jon_ramsey36@yahoo.com. Thanks
Is it possible to make my Splash screen invisible after someone checked the "Do not show me this screen again" just while that current session? Is there a way of using flags and a system table or query that would allow me to do so? Thank you:)
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.
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 few forms that look fine when in Design view, but which appear as plain grey screens when opened in Form view. These were working perfectly (i.e. visible in both views) until about half an hour ago.
The only things I have changed are some of the calculations behind certain fields.
[URL] making text boxes visible or invisible on a report depending upon criteria selected on a criteria form.
* I have a form [Frm_REPORT_Parameter_01] which has is a criteria selection menu related to a report. Among other criteria, is a combo box [CboGrade] which has the following options to select from "All", Excellent", "Good", "Fair", and "Poor"
* I have a report [FacilityIdentityReportDR]
* On this report, I have a trext field [TxtConditionHdr] that I want to make visible or invisible depending on what is selected in the form as criteria.
* I have a query [QryRPTFacilityIdentityRating01d]
The form criteria feeds the query that is the source for the report and the VBA coding behind the command button of the form is below. I have bolded my vba coding attempt to make the text field visible or invisible.:
Private Sub Command22_Click() Dim strCrit1 As String Dim strCrit2 As String Dim strCrit3 As String Dim strCrit4 As String
When I checked my Check box(YES) few steps turns invisible which works fine...but when i unchecked(NO) it should display again but it doesn't show up..how can i make it to display when i unchecked it again.. My code has shown below:
Code: Private Sub BreechDellst3mnths_Click() If BreechDellst3mnths Then Me.AvalaHumaResoO.Visible = False Me.TranIssuesO.Visible = False Me.Supply_Equp_drugsO.Visible = False
How do you open an invisible form when the database opens. In the database's startup options I have the database open a form, however, for some reason I can't set it to an invisible state.
My users run macros in their programs (not forms) the sole purpose of the form is to track which users are logged in the database or not. Therefore, when the form opens/closes, a user-table updated.
I don't want the users to be able to see this form, but I have no way to keep it hidden. More importantly because no other forms are being used or opened on load... I can't open the form hidden. Does anyone know anyway around this?
I have a form display project hours and also caculation of total for each project.
A user can spend time on multiple projects each day, I would like all zero invisiable. I had tried to set all default values to null (nothing) instead of zero. It causes problem in caculation of total.
I remember in Excel, it can make zero not to display, can we do this on an Access Form?
(Something I also want to know if this is possible. This is a time sheet, is anyway we can do on the form that projects (records) can be displayed horizonatally (on the top) while the dates can be displayed vertically (on the left), ,more like a transposed. But it would not change the struture of database (just display) so the date remains a field and projects are records.)
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
hei hei can you think for me 1 more second , PLEASE because I made all my menus invisible in startup. BUT when I open a form , for every form a taskbar icon is getting created. whwen I click any of the taskbar button of my my project forms, the Database window is apearing. I don't understand why is it coming , I don't want it to apear when users are working on the project. but before it is not apeared but it is happening since yesterday only. please help me in lettimg me the reason for the appearence of Database window. thank you for your time. Kiran.