Topics Search

Access 2003: List of "TAG" property of all label controls

Access 2003: List of "TAG" property of all label controls
Views: 11
I have a DB created with Access 2003 on XP Pro SP3.
I would like to check the "TAG" property on all Label controls.
I can do it without problems if the forms are opened, but I haven't found yet a solution when the forms are closed.
I have found the below example on Access Help where it uses AllForms expression.
Unfortunately it returns only the form's name and it seems that there is no way to use the object AccessObject to manage the controls inside the form.

Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllForms collection.
For Each obj In dbs.AllForms
If obj.IsLoaded = True Then
' Print name of obj.
Debug.Print obj.Name
End If
Sponsored Links:

Similar posts...


A2007 Some Combo Boxes changing back color on their own as they loose focus?

A2007 Some Combo Boxes changing back color on their own as they loose focus? Icon
Access 2007 as really done it this time. On one form I have five Combo Box controls. I have been working most of the afternoon on UI formatting. Now 2 to 3 of the 5 controls SOMETIMES change their background color from white (asit should be) to the grey that is the form's background color.

Of the controls that do this, at least one SOMETIMES decides to stay white for some list values and only do the grey change color for some values.

Other controls consistently shift to grey when they loose focus.

Thus far, I was only able to find one page mentioning this on the Internet: "2007 Access Combo Box changes Background color after tab through f" [LINK]

I do not see the Alternate Color property on my A2007 Combo Box controls. I do see the property for the "Detail" portion of the Form the Control is placed on. I have already tried my Decompile / Compact / Compile process, and that did not correct the misbehavior.

Modifying Label Caption in VBA Code from Form?

Modifying Label Caption in VBA Code from Form? Icon
I have a form that opens a report, and before I open that report I'm trying to change the caption of a label on the report. I'm having troubles accomplishing this. The label is named lblFilter, I've tried.

Report_MyReport.Controls("lblFilter").Caption = txtDate.value
Report_MyReport.lblFilter.Caption = txtDate.value

And, it just not working. I'm not sure how to reference that label's caption property properly.

Invisible Controls In Form View/DE "No" Prop Issue

Invisible Controls In Form View/DE "No" Prop Issue Icon
Yet again, buggy, frustrating, confounding Microsoft has managed to make a horrifyingly simple task inspire me to throw my PC out the window and shortly follow it. Consider this new gem:

I'm not getting existing table records showing up in Form View.

a) There's records in the table.
b) The form's Record Source currently contains one-to-one textbox controls from one table. The only control not sourced to that table is not currently sourced to ANYTHING.
c) The Form "Data Entry" property is set to "No"; the "Recordset Type" is "Dynaset (Inconsistent Updates)".for flexibility; the "Allow Additions" property is set to "Yes".
d) The Form Detail "Visible" property is set to "Yes".

Given those, why in the world would I not be seeing the 14 records in the source table, especially with the "Data Entry" property set to "No"?!

Access 2007 - Change Backcolor Of Specific Labels

Access 2007 - Change Backcolor Of Specific Labels Icon
I have a series of labels on an Access Form.

Depending on the labels caption, I need to change the backcolor.

The first 5 characters of the labels will be the same (Cap x).

Cap 1-1
Cap 1-2
Cap 1-3
Cap 1-4
Cap 1-5

Cap 2-1
Cap 2-2
Cap 2-3
Cap 2-4
Cap 2-5

I want to change all labels where the number portion begins with 2, so I do this

Private Sub Command1_Click()
Dim ctrl As Control
For Each ctrl In Forms("NameOfForm").Controls
If TypeOf ctrl Is Label Then
If ctrl.Caption Like "Cap 2" Then
ctrl.BackColor = vbBlue
ctrl.ForeColor = vbWhite
End If
End If
End Sub

All of the labels have their backstyle set to Normal.

The problem is that none of the labels are getting their backcolors changed. I put a break on the code and stepped through is finding the controls on the form that are labels, but it is not find the label controls that have a caption like Cap 2.

Separating Labels and text boxes in Reports Access 2002

Separating Labels and text boxes in Reports Access 2002 Icon
If I drag a field from my field list, how can I "undock" the label from the text box so I can rearrange the alignment of each field and label?

I know I can create blanks boxes and labels or use cut and paste, but using the field list is faster if I could figure out how to detach the label from it's text box.

Setting Properties for Multiple Objects in a Collection or Array Simultaneously

Setting Properties for Multiple Objects in a Collection or Array Simultaneously Icon
I have a form which includes an option group and multiple controls that I would like to hide if a user selects a certain option in the option group.

The option box is called fmeKnitWovenOther. There is a label called fmeKnitWovenOtherLbl that I would like to hide when any option is selected and a number of controls I would like to hide only if the user selects option 2.
The problem is that I have set the .visible property of every control individually, but I will need to expand this form and add more controls to be hidden for the other two options. If I keep setting the .visible property for every control manually, I am going to wind up with a giant list of controls all manually set to .visible = True and .visible = False depending on theIf or ElseIf condition.

Text-Based Controls: The Label

Text-Based Controls: The Label Icon
A label is a control that serves as a guide to the user. It provides a static text that the user cannot change but can read to get information about another control on the form. You can also use it to display simple information to the user. Most controls on the form are not explicit at first glance and the user would not know what they are. Therefore, you can assign a label to the control as a help to the user.
Topcis: The Label, The Text Box, The Command Buttons, Combo and List Boxes, Radio Buttons, Check Boxes and Toggle Buttons.

Need help on MS Access

Need help on MS Access Icon
I am creating a database using access 2003 for myself.
Everything I key in a new record I have to manually type in the name in the first field, it is time consuming if the name is long.
So I created a drop down list.
I wanted to get the data on my "name" field, so during the list creation I choose the option:
"I want the list box to look up the values in a table or query"

Custom buttons in access 2003

Custom buttons in access 2003 Icon
I am trying to make some custom buttons using image controls on a form.

I simply want the image to change on events such as mouse down etc.

Here is the code I am using in the event property for On Mouse Down: Private Sub GreenButton_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
GreenButton.Picture = "D:\Projects\Images\GreenButtonHover.bmp"
End Sub

When I execute this (IE. open form view and press button) it does change the image as expected, but it also makes the whole form flash like it is reloading the form. Is there a better way to do this in access 2003.

Also, is there a way to embed the button images so they don't have to be referenced to the local harddrive?

Also, If I am using Access 2010 is there a way to force the software into emulating/limiting itself to 2003 capabilities. I have to develop this project to be completely 2003 compatible.

grow text box horizontally

grow text box horizontally Icon
I have a report where I need to insert a currency value into a sentence. Right now, I have a label that says "Please submit the commission amount of " then a text box that shows the amount, then another label with "to the following address." The problem is, depending on the amount of the commission, there is either not enough room for the entire amount to show, or there is toomuch extra space in the sentence to make it look right.

I know there is the "Can Grow" property, but that only seem to work vertically, not horizontally. Is there another way I could dothis?