By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

call functions in another module

100+
P: 232
Expand|Select|Wrap|Line Numbers
  1. Sub main()
  2. Call mod1.fn1
  3. Call mod1.fn2
  4. End Sub
this function which is in mod2 calls only function 1 but not function 2.kindly help
Thanx in advance
access 2007
vba
Jun 27 '12 #1
Share this Question
Share on Google+
5 Replies


P: 68
kkshansid,

I think no one would be able to help you with regard to your question. You need to add more details to help us to analyze and diagnosis your problem. It would be useful if you could add the code for fn1 and fn2.

All in all, I can suggest the followings as of now:

1- Check if fn2 is declared as private function. If it is so, changed it to public
2- Compile and test fn2 code to see if there are errors which could prevent the calling process.
3- Make sure that fn2 doesn't require parameters. If it does, then you need to provide.
4- Add “on error” statement to your code to trap the errors, if there are any, so you can know what the exact problem is.

Regards,
Jun 27 '12 #2

NeoPa
Expert Mod 15k+
P: 31,418
I expect mod1.fn2 has not been declared as a Public procedure. If it isn't as simple as that then I suggest you include details of what happens when you try to run it. Simply saying it doesn't work is not something we'd expect from someone with over 100 posts to their name.
Jun 27 '12 #3

100+
P: 232
both function run if i run them individually but in one call from another function only function first runs.i didnt declared it private but by default its public
Expand|Select|Wrap|Line Numbers
  1. sub f1
  2. 'some code
  3. end sub
  4. sub f2
  5. 'some code
  6. end sub
Jun 28 '12 #4

P: 68
Brother, I have mentioned that u need to include your codes so we can help you. Also, you need to state exactly what the problem is.Also, When you said your fn2 cannot be called, describe what you get in run time!

Help us so we can help you
Jun 28 '12 #5

NeoPa
Expert Mod 15k+
P: 31,418
NeoPa:
If it isn't as simple as that then I suggest you include details of what happens when you try to run it. Simply saying it doesn't work is not something we'd expect from someone with over 100 posts to their name.
Did you read the main part of what I posted? It seems such a waste of time and energy repeating myself.
Jun 29 '12 #6

Post your reply

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