[AccessD] Frame question

Michael Welsh mike at welshfam.org
Sun Jul 4 19:45:30 CDT 2004


Oleg,

I use a function that cycles thru the form controls. If the .tag property
matches, the control is set to null (you could do anything to the control
like set it to zero, as well). Call it NullTag("TagData")

Public Sub NullTag( ByVal strTagData As String) As Boolean

On Error GoTo Error_NullTag

Dim ctrl As Control
Dim frmForm As Form
Set frmForm = Application.Screen.ActiveForm

For gintReit = 0 To frmForm.Count - 1
    Set ctrl = frmForm(gintReit)
    If InStr(1, ctrl.Tag, strTagData) Then
        ctrl = Null   'alter this line to set the control as needed
    End If
Next gintReit 

I use a similar sub to make the control visible or invisible as needed. 
Call it in code  ToggleControl "False", "TagData" to set all controls on the
active form 
Visible = false if the tag data = "TagData". Use you own tagdata. Use True
to make the controls visible.

Public Sub ToggleControl( ByVal fSwitch As Boolean, ByVal strTagData As
String)

On Error GoTo Error_ToggleControl

DoCmd.Hourglass True

Dim ctrl As Control
Dim frmMF As Form
Set frmMF = Application.Screen.ActiveForm
For gintReit = 0 To frmMF.Count - 1
    Set ctrl = frmMF(gintReit)
    If ctrl.Tag = strTagData Then
        ctrl.Visible = fSwitch
    End If
Next gintReit

Hope this helps.  

Mike

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Saturday, July 03, 2004 2:57 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Frame question

Hi Oleg

> I have about 25 textboxes, which on a click on a button i want their 
> context cleared, and half of them hidden is there a way to place them 
> in 2 frames, and have all items inside 1 frame cleared, and 2nd frame 
> hidden and cleared ?

Not that I know of, but you could let a rectangle cover the textboxes (bring
it to front), then setting this rectangle's Visible property to True or
False.

/gustav

--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list