clear part of a form but not all

A

Access lightweight

Is there any way to clear some of the fields on a form when I save and clear,
I have a form with 30 fields and many change only every 12 hours for the
users.
 
R

ruralguy via AccessMonster.com

What are you doing to "save and clear" the form?

Access said:
Is there any way to clear some of the fields on a form when I save and clear,
I have a form with 30 fields and many change only every 12 hours for the
users.
 
L

Linq Adams via AccessMonster.com

I agree with Allan that we need to know exactly what you're doing to "save
and clear" the form, but generically, the way you "group" controls for this
kind of manipulation is to use the little known Tag Property.

Select the controls you want to clear, then got to Properties - Other and
enter a value in the ***Tag*** Property. Don't get confused if you see a
***SmartTag*** Property! This is something else entirely!

For the purposes of this demo, we'll make the Tag Property

Fields2Clear

Enter this in the Tag Property box (without quotation marks.)

Then, in an appropriate event, use this code.

Dim ctrl As Control

For Each ctrl In Me.Controls
If ctrl.Tag = "Fields2Clear" Then
ctrl.value = ""
End If
Next

End Sub


Linq

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
J

John W. Vinson

Is there any way to clear some of the fields on a form when I save and clear,
I have a form with 30 fields and many change only every 12 hours for the
users.

The need to do this might imply that your tables aren't properly normalized.
Do you have some fields which repeat through many records, while other fields
change value from record to record? If so, you may do better to have two
tables in a one (the more static data) to many (the variable data)
relationship.


John W. Vinson [MVP]
 
L

Linq Adams via AccessMonster.com

Or use the AfterUpdate event to assign the DefaultValue of repeating fields.
As said before, we really to know exactly what you're doing to "save and
clear" the form!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
A

Access lightweight

Thank you all for the help...I don't have time to try right now, but will and
I am sure will help..Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top