473,323 Members | 1,551 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,323 software developers and data experts.

Handling a button click in a module

132 100+
Hello guys,

I'm trying to create a generic module that I can easily add to different projects if needed.

It creates a menuitem but now I would like to handle the click event of that menu also in my module.

but just adding this:
Expand|Select|Wrap|Line Numbers
  1. Public Sub mnuAboutSub_Click(Index As Integer)
  2.  debug.print "About"
  3. End Sub
  4.  
doesn't do anything.
Anybody have any idea how I can do this?

Greets,
Cainnech
Feb 12 '11 #1

✓ answered by Guido Geurs

You can't detect a Menu event in a module.
Just put the code in the module and call the function from the MNU_Click event.
like: add Text1 + Text2 to Text3:
form=
Expand|Select|Wrap|Line Numbers
  1. Private Sub mnutest_Click()
  2.    Text3.Text = Add_Text(Text1.Text, Text2.Text)
  3. End Sub
Module=
Expand|Select|Wrap|Line Numbers
  1. Public Function Add_Text(INT1 As Integer, INT2 As Integer) As Integer
  2.    Add_Text = INT1 + INT2
  3. End Function

3 1539
Guido Geurs
767 Expert 512MB
You can't detect a Menu event in a module.
Just put the code in the module and call the function from the MNU_Click event.
like: add Text1 + Text2 to Text3:
form=
Expand|Select|Wrap|Line Numbers
  1. Private Sub mnutest_Click()
  2.    Text3.Text = Add_Text(Text1.Text, Text2.Text)
  3. End Sub
Module=
Expand|Select|Wrap|Line Numbers
  1. Public Function Add_Text(INT1 As Integer, INT2 As Integer) As Integer
  2.    Add_Text = INT1 + INT2
  3. End Function
Feb 13 '11 #2
Cainnech
132 100+
Thanks Guido for the answer, unfortunately, it was not that what I was hoping for :-)
Feb 13 '11 #3
Guido Geurs
767 Expert 512MB
Is it possible to attach your code in Bytes?
Feb 14 '11 #4

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

Similar topics

6
by: Michael Johnson Jr. | last post by:
I am trying to handle a button click event, which updates a web control table with data. The button is dynamically created in the table itself. When I call updateTable() in the Page_Load the new...
4
by: Mark Lingen | last post by:
I've found a problem with postback event handling and webcontrol buttons. Try out the following code in an ASP.Net project and you will see. Create a web project in VB.Net and drop this code...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
1
by: Mauritsius | last post by:
I have a simple page where I would like to modify a repeater (bounded to a dataset) if a button (outside the repeater) is clicked or not. I tried to solve this with a button click event that...
1
by: Martin | last post by:
Hi, I have produced a custom server control that simple outputs a row of 26 buttons, one button for each letter of the english alphabet. now what I would like to do is catch the button click...
3
by: Imran Aziz | last post by:
Hello All, I have a search text and button that post data and my button handler filters the repeater control. However when the button is clicked the first time. The page_load event is being called...
1
by: ODAN | last post by:
I have an ASP.NET application written in C#. one of the web form where you create user information and user name has a button to click to print selected user information for the users record....
7
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I create button in the code ( Dim Button as new Button), not using button web component (means not drap button and drop it ont he webform), after that I try to use button_click event,...
1
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
0
by: ADN | last post by:
Hi, I am currently extending the GridView control and would like to add a button to the GridView so that it will automatically render one button at the top of the grid. I have a click event for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.