PDA

Click to See Complete Forum and Search --> : MS Access tool to update field values


royster
Oct 5th, 2004, 03:26 PM
Hi
Is there an MS Access that will allow me to programatically update the Tag value for controls on a form?

For example I have 20 controls in a form, and I wish to add a value to the tag field on each control, based on a value from a file or database. I know I can do this at run time, but I was wondering if I can do this by updating the control at design time, without having to do this one control at a time manually?

Thanks

RobDog888
Oct 5th, 2004, 03:34 PM
If they are the same type of control or they all have the .Tag property,
then you can select them all and then change the Tag property in
the properties window. It will change all selected controls to
what ever you type in as the value. Same as in VB.

HTH

royster
Oct 5th, 2004, 04:07 PM
Thanks for the reply.

The values are different. Each control has a different value, and each value would be unique.

RobDog888
Oct 5th, 2004, 04:11 PM
Then you would need to determine what event should be setting
or updating the tags. Then you could call a procedure to update
them.

RobDog888
Oct 5th, 2004, 04:14 PM
Something like this will update the tag properties every time the
recordset is navigated.
Option Explicit

Private Sub Form_Current()

Forms![MyForm]![MyControl1].Tag = "Some Value 1"
Forms![MyForm]![MyControl2].Tag = "Some Value 2"
Forms![MyForm]![MyControl3].Tag = "Some Value 3"
Forms![MyForm]![MyControl4].Tag = "Some Value 4"
Forms![MyForm]![MyControl5].Tag = "Some Value 5"

End Sub