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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button colour on form 8

Status
Not open for further replies.

slames

Technical User
Nov 5, 2002
211
GB
How can I change the colur of a button on a form?, can't find that property anywhere...
Thanks
Steph
 
Rick works like a charm. Thanks so much for your simple solution. Janet Lyn
 
Okay, now I have two stupid feel-like-an-idiot questions. Once I put this code into this one label, is there not a way to just copy this same code into each of my command buttons throughout my database or do I have to complete the same steps each time for each new button? Also, I think I am missing the forrest because of the trees; is there anywhere in this website I can do a search by THREAD? Thanks guys, JL
 
Janet,

I'm afraid making lots of buttons like this could be pretty laborious.

In the best case, which is making an exact duplicate (including the Caption) on another form, you can select the two labels and the command button together, copy, and paste onto the other form. Then select all the code for the command button, copy, and paste that into the other form's module.

To duplicate a button on the same form takes a bit more work. You still copy and paste as above, but you'll have to change the caption and size of its little (caption/focus) label. You'll probably also want to change the names of all three controls. After you do that, you can copy and paste the code into the same form module, giving you duplicate procedures. You then have to select the code you pasted and do a Find/Replace operation (using the Selected Text option) to rename the controls in code. Fortunately, when you do the Find/Replace, Access automatically sets the event properties for the new "button" to "[Event Procedure]" for you, so at least you don't have to do that.

By "search by THREAD" do you mean search for a thread, by thread number? No, I don't think you can--but usually, you shouldn't need to. If it's referenced in a post, text with the format "Thread702-537223" will automatically become a link to the referenced thread. If you want to track a particular thread, you can mark it for email notification and sort your forum threads with the marked ones at the top (see the "Thread Order" sort options at the top of the forum's main page).

If you have some other need, let us know what it is. It may already exist, and if not, I'll suggest it to the management as a possible improvement. They're very open to improving the site.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Rick,
Is there a way to save threads so that you can use them for reference at a later date

Regards

Paul
 
Paul.....try the "E-mail This Thread" button and email it to yourself.....outside of the, just copy past the entire thread into a word or notepad file....

****************************
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
 
Thanks Rick. I print and save all threads that are helpful in case I need for future reference. Some of these threads are ones I have not participated in. But, they may have changed since I printed them out, so two or three times in the past couple days I have wanted to just type in the thread number so it would take me right to the thread. Sometimes a search by word is vague. However, I did start doing the search by handles and that was okay. So, I appreciate all your comments and helps. Pink star to ya, Janet Lyn
 
To give credit where credit is due, it was mstrmage that answered smurf01's question, but you're welcome if you found my other post helpful.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Janet,

How about doing a search using the entire subject line, and the "All the words" and "Subject" options? It seems to me that would almost always retrieve just the one thread you're interested in.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Hi All,

If you're interested in "prettyfying" your forms maybe take a look at this procedure I did for someone last year


The file to look at is Buttons.zip

To colour the images to your form's backcolor, open the bitmaps with MS Paint and fill with the colour of your choice.

Where as this isn't exactly a button example, this method has gone down very well with clients in the past.

Bill
 
Robert and Rick, I just had to come back to this thread and give you both another pink star. Man, the sink and unsink on the button looks GOOD. Thanks again. JL
 
I had a form that needed a few command buttons but did not like to looks of all of those buttons.

So what I did was to use a label, and then put an event procedure on the on_click.

This way I can format the label the way I wanted, and it still functioned as a command button.

Thought that I would share this.



 
Yakdogs, that is what I did also. But make it look better by doing what mstermage1768 said above with the sink and unsink. It really makes the form more realistic. There is a box above with really long code and mstermage remarks are two boxes down. Well worth the read. Janet Lyn
 
Hi janetlyn,

If you are referring to my code being so long, it's ok. It is rather long, but that's only because in the given example, I'm using 4 controls x 3 events, Mouse up, down and move. Which I've had to, to give the "Hover Button" effect. The code also by using:

If X > 0 And X <= 365 And Y > 0 And Y <= 330 Then

allows the user to change their mind if they click a &quot;button&quot; by mistake to drag the mouse off the &quot;button&quot; to cancel the click, just like on a &quot;real button&quot;.

I have promised in another thread to add a &quot;New Record&quot; button to my example. While doing this I will see if I can shorten the code, but it's ulikely.

I've often said this, that I love Tek-Tips for all the different views and methods demonstrated. I've always worked on my own and got my examples from Help or manuals. It's been quite an eye opener using this site.

Anyway, the main thing is that you got what you wanted from all the great contributors above to this thread.

All the best

Bill
 
No, No, Bill, I would never insult anyone on this forum. I like everyone too much. Besides, any code given is code I can refer to later and pick up snippets of how to write code for my specific situation. The reference to the long code was to Norris68 and I only referenced it so if Yakdogs wanted to find the code I was talking about he could just start up the screen and find the long code and then go down two boxes instead of having to read every box trying to find my reference. Thank you for your help. I have already downloaded your code, just haven't decided whether to use it or not. I have not gotten around to playing with the stuff like taking off scrolls, menus, toolbars, etc. When I do, I'm sure I will be calling your name. Have a wonderful day. Janet Lyn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top