Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Loudon, New Hampshire, USA
    Posts
    125
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Field's Tag (Office/Access 2000)

    Hello World,
    Once more I want to do something strange! I have in the past built systems using other products. One thing I have found is Clients will call you over the littlest things, and they are lazy (aren't we all?). So one way I got the calls down was to display help field by field on the form. Some of the products I used, this was how Help worked, Others I made it work this way. Well I found that In the property sheet for a field on a form. We have a property called tag, which can contain up to 2,048 bytes. This usually should allow me all the room I need for Help. So when a field gets focus I place my Tag data into a field on the form which will display four lines of 85 Characters and has scroll bars so they can see the rest, if any. This is kool and I have it working fine. So now my mother's son decides would it not be great to be able to Print off all of this tag data. So he looks for where Access hide it. He looks high, he looks low. And guess what??? He can not find hide nor hair of it!! So I am hoping (finger crossed along with toes and eyes), that some one out there knows of a way for me to get the field tag data, hope hope!!!!
    Also while I am here does any one know why Access does not allow you to:
    1. Change a buttons background color?
    2. Allow both a picture and text on a button?
    I have used other products that did and found the Clients liked it.
    Thank you,
    Sarge

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form Field's Tag (Office/Access 2000)

    I don't understand your first question. What do you mean by "hide"? You seem to be able to enter something in the Tag property, so you know where it is.

    Other questions:
    1. The background color of command buttons is controlled by the settings in the Appearance tab of the Display Properties control panel.
    2. You can use an image control with a transparent label control superimposed on it, and use the On Click event of the label to simulate a command button with a picture and a caption.

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Form Field's Tag (Office/Access 2000)

    Do you by chance mean that you don't see the tag data in the Documenter under Analyze? That is indeed the case. However you should be able to do something with VBA to write out the contents of each control's tag property to a recordset, report or even to a Word document. Or you could use the FMS Total Analyzer tool to do the job for you.
    Wendell

  4. #4
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Form Field's Tag (Office/Access 2000)

    Note re Documenter: Testing in Access 2K revealed that the Documenter omits a form control's Tag property only if the property returns a zero-length string (default if you do not set Tag to some text). If the Tag property contains text, then the Documenter includes it in its report (see attached example).

    As noted, it shouldn't be hard to output the Tag property for each control on a form to one format or another. Simple example that prints this info to Debug window:

    Public Sub EnumerateTags(ByRef strFrm As String)
    On Error GoTo Err_Handler

    Dim frm As Form
    Dim ctl As Control
    Dim strMsg As String

    DoCmd.OpenForm strFrm, acDesign, , , , acHidden
    Set frm = Forms(strFrm)

    Debug.Print "Control Name:", "Tag Property"
    For Each ctl In frm.Controls
    Debug.Print ctl.Name & ": " & IIf(Len(ctl.Tag) > 0, ctl.Tag, "(None)")
    Next ctl
    DoCmd.Close acForm, strFrm

    Exit_Sub:
    Set frm = Nothing
    Set ctl = Nothing
    Exit Sub
    Err_Handler:
    strMsg = "Error No " & Err.Number & ": " & Err.Description
    Beep
    MsgBox strMsg, vbExclamation, "ERROR MESSAGE"
    Resume Exit_Sub
    End Sub

    Test results:

    EnumerateTags "frmTextLen"

    Control Name: Tag Property
    Field1_txt: Tag1
    Field1_Label: Field1_Label Tag
    Field2_txt: Tag2
    Field2_Label: (None)
    Field3_txt: Tag3
    Field3_Label: (None)
    LabelTextLen1: Tag Label1
    LabelTextLen2: Tag Label2

    Code could be modified to check Tag only for certain controls based on ControlType property, etc. Also could loop thru all forms (or selected forms) in current database if desired, etc.

    HTH
    Attached Images Attached Images

  5. #5
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Loudon, New Hampshire, USA
    Posts
    125
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Field's Tag (Office/Access 2000)

    Thanks Hans!
    Sarge

  6. #6
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Loudon, New Hampshire, USA
    Posts
    125
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Field's Tag (Office/Access 2000)

    To Wendell and Mark D,
    Thanks guys. I was hoping to find the tag data in one of the MSys Tables. I will have to play with this as I am not sure I fully understand every thing until I dive in. If I get stuck it will be getting the Tag data into a file so I can build a report for the Client. Once again Thanks.
    Sarge

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •