Darren DICK
d.dick at uws.edu.au
Sun Jul 4 20:04:45 CDT 2004
Hi Oleg
I do stuff like this using the tag property of a control
If a control can be cleared I give it a TAG property of say...1 if it can be
invisible I give it a TAG property of 2 and if it can be both I give it a TAG property of 3
Then based on your circumstances of data entry
run one of 3 code options eg
to make invisible all the controls thatcan be be invisible try...ps_SetVisibles 1
or
to clear all the controls that are allowed to be cleared try...ps_SetVisibles 2
or
to clear and make invisible the controls you want cleared and invisible try ps_SetVisibles 3
eg Make a module on your form like this
Private Sub ps_SetVisibles(intWhatValue As Integer)
'This code looks for all controls on a form that have a TAG that matches the
'intWhatValue passed to this sub then makes that control or controls visible or
'clears their contents or both
Dim ctl As Control
Select Case intWhatValue
Case 1
For Each ctl In Me.Controls
If ctl.Tag = 1 Then
ctl.Visible = False
End If
Next
Case 2
For Each ctl In Me.Controls
If ctl.Tag = 2 Then
ctl.Value = ""
End If
Next
Case 3
For Each ctl In Me.Controls
If ctl.Tag = 3 Then
ctl.Visible = False
ctl.Value = ""
End If
Next
Case Else
MsgBox "can only deal with values 1 2 or 3"
End Select
Hope this helps
Darren
----- Original Message -----
From: <Oleg_123 at xuppa.com>
To: <accessd at databaseadvisors.com>
Sent: Sunday, July 04, 2004 4:37 AM
Subject: [AccessD] Frame question
> 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 ?
>
>
>
> -----------------------------------------
> Make Money and Find Love at Finally.com
> http://www.finally.com/?link=webmail
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com