By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 1,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

Tag Property

P: 6
First off I wanted to Thank Everyone here for all your help!


How do I set the onclick Property Tag of a TextBox to = its Field.value? Example:

Me!FirstMI.Tag = Me!FirstMI.Value?

This Errors.
Mar 19 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 2,653
Hi, there.

Tag is a String type property, while Value is Variant.
VBA is not very type sensitive and often could silently make type conversion though its better to to make it explicitly. I guess that error raises when Value returns Null. You should use Nz() function to replace Null with "".

Mar 19 '08 #2

Expert 2.5K+
P: 3,532
You really need to post error messages when you have a problem. I, like Fish, suspect that a null value is giving you your problem, and can be addressed with Nz().

You don't say wahat you're doing here, but you need to be aware that assigning the Tag property thru code like this only affects the Tag for the lifetime of the session. This Tag will disappear when the form is closed.

Welcome to TheScripts!

Linq ;0)>
Mar 19 '08 #3

P: 6
I understand. Thank you! I was using it to store the value of a field for Audit Trail.

Sample code:
sql="Me!pwcuser & Changed Employee & Me!FirstMI & Me!LastName & Payrate FROM & Me!payrate.Tag & TO & Me!payrate.Value"

It was a NULL value that was causing the problem. I added code to update all fields of the form on current event to copy the field value to the Tag value of the field for later comparison. But NULL was causing error.

Will keep your ideas in mind in the future
Mar 20 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.