Yorkshire Divers

Deep Blue Technical
Go Back   YD Scuba Diving Forums > Non-Diving Related Forums > Technology
User Name
Password

Welcome to the YD Scuba forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Technology: Discuss VBA for Access in the Non-Diving Related Forums forums: As I am between contracts I am back on teaching myself the basics of VBA. BTW I am using Access ...

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-02-08, 11:33 AM
Ian@1904's Avatar
Ian@1904 Ian@1904 is offline
Team Starburst
 

Join Date: Jan 2004
Location: Bedfordshire
Posts: 3,914
Ian@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold waterIan@1904 is a scuba diver - cold water
Question VBA for Access

As I am between contracts I am back on teaching myself the basics of VBA.
BTW I am using Access VBA for Dummies and the Microsoft Running MS Access books.

I understand the basics to set the properties for a control e.g.
Private Sub ccc_AfterUpdate()
objectname1.BackColor = vbGreen
End Sub


How can I set the properties so that on opening a form for several controls eg objectname1, objectname2, objectname3 I can set all to vbgreen without repeating all the code for each control. I think I need to create a class object but what code to enter in there?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-02-08, 01:48 PM
RonProwse's Avatar
RonProwse RonProwse is offline
why does it always do that......
 

Join Date: Feb 2006
Location: Chatham
Posts: 496
RonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm waterRonProwse swims in warm water
you need to do a for each loop over the controls in the form then test each one to see if it is of type button then you can set the property
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-02-08, 02:34 PM
wilbo's Avatar
wilbo wilbo is offline
Chimp 4
 

Join Date: Jul 2004
Location: Swindon (the hairy sphincter of the world)
Posts: 5,405
wilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the waterwilbo is never out of the water
Quote:
Originally Posted by RonProwse
you need to do a for each loop over the controls in the form then test each one to see if it is of type button then you can set the property
what he said..

you loop through the controls collection testing for type objectname1 etc and call your AfterUpdate code..

(got slightly confused momentarily by your use of the word 'properties' )

Last edited by wilbo : 08-02-08 at 02:38 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Sponsored Links

Yorkshire Divers - RSS Feed
All times are GMT +1. The time now is 11:02 PM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0 RC6
Trademark and all rights reserved : © YD.com Ltd (2006)
YD.com Ltd (Registered in England - 05886696)
Other sites : Golf Clubs | New Premiership Football Kits | MP3 Portable Players | MP3 Players For Sale | Replica Football Kits

Forums Directory