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

accessing sub from within

36
How can I call a sub associated for example with a button from inside my code?

for example
-------------------------
[code]private sub f_click()
Expand|Select|Wrap|Line Numbers
  1. end sub
  2. ---------------------------
  3. private sub s_click()
  4.  
  5. f_click()  <-- How I call this to run here?
  6. [more code]
  7. endsub
I tried run (f_click()), but didn't work
Jan 27 '07 #1
3 1639
missinglinq
3,532 Expert 2GB
Just like this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub s_Click()
  2.    f_click
  3.    [more code]
  4. End Sub
  5.  
Jan 27 '07 #2
NeoPa
32,556 Expert Mod 16PB
Are you running this from the same Form module as the F CommandButton is on?
If so then MissingLinq's answer is fine for you.
Otherwise you need to refer to the Form first in the call (I've assumed name of form is frmName to illustrate) :
  • Call Form_frmName.F_Click()
  • Call Forms("frmName").F_Click()
  • Call Forms!frmName.F_Click()
I use the Call command generally as it documents that the code is a procedure call, but this is not necessary for the call to work.
Jan 27 '07 #3
omozali
36
Are you running this from the same Form module as the F CommandButton is on?
If so then MissingLinq's answer is fine for you.
Otherwise you need to refer to the Form first in the call (I've assumed name of form is frmName to illustrate) :
  • Call Form_frmName.F_Click()
  • Call Forms("frmName").F_Click()
  • Call Forms!frmName.F_Click()
I use the Call command generally as it documents that the code is a procedure call, but this is not necessary for the call to work.

excellent thanks alot everybody
Jan 27 '07 #4

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

Similar topics

36
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
2
by: KimD | last post by:
I'm filling a dataset with the return of a stored procedure. The dataset contains a number of tables which I am naming within the stored procedure, however when I try to access the tables using the...
1
by: Paul Maidment | last post by:
Hi, I am a bit green when it comes to .net development so please excuse me if this question is obvious or has been asked before... I am trying to programmatically access a label control...
8
by: dwok | last post by:
I have been wondering this for a while now. Suppose I have a class that contains some private member variables. How should I access the variables throughout the class? Should I use properties that...
12
by: Steve Blinkhorn | last post by:
Does anyone know of a way of accessing and modifying variables declared static within a function from outside that function? Please no homilies on why it's bad practice: the context is very...
1
by: omantawy | last post by:
Hi, I have some legacy ASP web applications that use an unmanaged COM component to connect to a third party application. The third part application has moved to the managed code in the current...
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
0
by: Ignacio Machin ( .NET/ C# MVP ) | last post by:
On Jul 22, 9:41 am, "none" <n...@none.comwrote: Take a look at the Selected property of the RichTextBox control
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.