473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Making a Function for the Switch Board

Ericks
74
Trying again:

I use the standard Access Switchboard with 8 buttons. In the mouseover event of each button I have the label text change by following code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Option1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2. On Error Resume Next
  3. Call SetBold(Me, "optionlabel1")
  4. End Sub
That is 8 times this code which doesn't seem very efficient to me. Can I substitute this with a Function instead and that includes all 8 buttons? What would the Module look like?
Mar 13 '08 #1
4 1595
missinglinq
3,532 Expert 2GB
No, you'd have to call the function from each MouseMove event just as you are now. And to be perfectly frank, you're already over engineering this thing!

Why would you want to use

Call SetBold(Me, "optionlabel1")

every time the mouse moves over the button to call a function to accomplish something that can be done with this single line

YourButtonName.FontWeight = 700

It makes no sense to replace a single line of code with a function call when the function is going to use the same single line of code to accomplish the task.

Linq ;0)>
Mar 13 '08 #2
Ericks
74
Makes sense. And indeed it works. Beauty and efficiency lay in simplicity.

Thanks Linq.
Mar 14 '08 #3
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Mar 14 '08 #4
NeoPa
32,556 Expert Mod 16PB
As a full member now, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use the tags in future.

ADMIN.

PS. I just found that you've posted the same question twice as well. This is also mentioned in the guidelines so I'd be grateful if you avoided this in future.

Just to let you know, I will delete the other thread that now seems to be abandonned.
Mar 15 '08 #5

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

Similar topics

0
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits...
0
by: Mukesh Kumar | last post by:
Dear friends, I am very new to this forum. Please pardon me if this question has been posted before. I am looking for some Bulletin Board software like UBB, YaBB etc. I know Java but haven't...
1
by: Matthew Kelly | last post by:
I have pulled together a VB.net project that hooks the keyboard (Ref. Paul Kimmel's hooking program) and allow the user to send "mouse right clicks" via the SendInpuut function (mouse emulation...
14
by: dam_fool_2003 | last post by:
Hai, When I declare a zero-based array I get a compile time error stating that zero based array is not possible. But if I declare the same in the function argument I don't get any error. Is...
3
by: Thomas Nelson | last post by:
I'm trying to write a function that uses function pointers. Here's my errors: Board.cc:111: error: expected ',' or '...' before 'p1' Board.cc:111: error: prototype for 'int Board::play_game(int...
204
by: Masood | last post by:
I know that this topic may inflame the "C language Taleban", but is there any prospect of some of the neat features of C++ getting incorporated in C? No I am not talking out the OO stuff. I am...
14
by: v4vijayakumar | last post by:
In computer based, two player, board games, how to make computer play? Are there any formal ways to _teach_ computer, to choose best possible move? I know this is kind of off-topic here. Please...
50
by: Juha Nieminen | last post by:
I asked a long time ago in this group how to make a smart pointer which works with incomplete types. I got this answer (only relevant parts included): ...
2
by: pugazhraj | last post by:
hai experts, iam new to network field and in our office ethernet switch board is not working .could any one know what are the possiblities for the problem and plz help me to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.