Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tag property value set with a macro not saved 1

Status
Not open for further replies.

MackC

Programmer
Nov 8, 2001
23
0
0
US
When I use the SetValue action in a macro to set the value of the tag property of a text box on a form, the value in tag is not saved when I save the form. The macro is triggered by clicking a button. When I reopen the form, tag is blank. I have not tried doing this with VBA, but I assume the result would be the same.
 
Your right - I have just tried to write to Tag with no result yet I can read from Tag without any difficulty..
This is the same with a value list in a combo they cannot be changed by VBA - or if they can I have never been able to do it!
Another Microsoft FEATURE!!!
 
I have also tried to programmatically set the value of the tag property of an unbound text box using VBA. I then click the Save button to save the design of the form. When I reopen the form, tag is blank.
 
Hi,
I began to add to the confusion with this post when I was unceremoniously dumped out of Internet Exploxer. Guess that's what I get for running a full install of Office 2000 Premium (and a lot of other things on a 166mhz Pentium with only 90 meg of space left on the 1.2 gig drive).

As I had begun to say I am trying to get my head round what you guys are doing.

I have set up a small database to try out things from this forum. Have just added an unbound text box and unbound combo box to the form with tag and row source values blank, saved and closed the form. Then wrote two macros - one to open the form in design view, set the respective tag values to 21 and 56, then close the form - the other to act on the already open form and set the tag value of the text box to 73 and populate the row source of the combo box with the value list "one; two; three". In both cases the values set by the macros were retained on closing and reopening the form.

Have I missed something about what you were initially trying to do?

Intuitas
intuitas@yahoo.com.au
 
Hi,
being as I work most of my time in 97 I generalise with what I consider to be true about that version. I have just tested what you say about filling a value list of a combo and you are right it works in 2000, But I still can't get a string to save against a tag.
With you using numbers only in your entry could it be possible that you are setting the value of TAB as opposed to TAG?

Frank J Hill
FHS Services Ltd.
frank@fhsservices.co.uk
 
Hi Frank,

Got thrown out again - now I know why. Forgot I had set my forms to retrieve email messages from Outlook (not successfully) and opening it gave me 14 instances of the form - with my 'memory' sailing so close to the wind it simply ran out os space.

Ironically I was using 97 on my 486 until two weeks ago when I moved to this temporary set up and decided to install 2000!

Back to the problem in hand.

You're right - and I'm right!
My macros work when the form is opened in Design view with the value of the tag property being set to either numeric or text values and the Value List populated as required: and these changes survive closing and reopening the form - HOWEVER - if I try to use the macro to set these values in the form when opened in Form view then although the values are set by the macro (for some reason the properties box likes to open with the form in Form view so I can see the changes effected), the values do not survive closing and reopening.

Although I haven't tried the code option I presume it too will allow you to set these attributes permanently in Design mode but not otherwise. In my solution to the query I had regarding searching (and thank you for your emails & Multi Searcher - I will reply tomorrow as its 1:15 am here now)I actually set tag properties dynamically in Form mode using code but retrieved them again before closing the form, so that much works.

Regards,

Paul Reader
 
Paul, I think you've got the answer. Based on responses I've gotten from other forums, no properties that are set programmatically in the form view can be permanently saved. However you can save properties that are programmatically set in the design view. I'm surprised that this important information is not more well-publicized. There is no mention of it that I can find in Help, in the MS knowledge base, or in any of the manuals that I own. I also was not able to find any discussion of it by searching Google Groups.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top