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

How to create call a Module

100+
P: 134
I have many forms, in every form, I need to validate a Process, so instead of coding to every forms, I could think of using module, but not sure how to do it.


(1). In each form how do I call the module to check the Process and (2) return me the result.

The result return would allow me to fire up the next form. For example if result return is "Frmcust"
I would then code frmcust.show


In the module I use to check the process, but not so sure how to write the
proper coding.
Module
if process = "CUST" then
frmName="FrmCust"
elseif process = "VENDOR" then
frmName = "FrmVendor"
elseif process = "STOCK" then
frmName="frmStock
end if
Apr 30 '08 #1
Share this Question
Share on Google+
5 Replies


debasisdas
Expert 5K+
P: 8,127
create a procedure and call that where ever you want .
Apr 30 '08 #2

100+
P: 134
create a procedure and call that where ever you want .
Do i need to create procedure on every form ?,
Apr 30 '08 #3

daniel aristidou
100+
P: 491
Do i need to create procedure on every form ?,
Try
Expand|Select|Wrap|Line Numbers
  1. Module Process_procedure
  2. Public Sub(ByVal Cust as Variant)
  3. Dim Formtoopen as form
  4. 'Your if condition
  5.  
  6. Formtoopen.Show
  7. End sub
  8.  
  9.  
  10. 'to call this just type:
  11. 'Replacing Cust with the correct value or :defining it before hand
  12. Call Process_procedure(CUST)
May 3 '08 #4

100+
P: 134
Try
Expand|Select|Wrap|Line Numbers
  1. Module Process_procedure
  2. Public Sub(ByVal Cust as Variant)
  3. Dim Formtoopen as form
  4. 'Your if condition
  5.  
  6. Formtoopen.Show
  7. End sub
  8.  
  9.  
  10. 'to call this just type:
  11. 'Replacing Cust with the correct value or :defining it before hand
  12. Call Process_procedure(CUST)
Thank You so much will try out
May 3 '08 #5

debasisdas
Expert 5K+
P: 8,127
Do i need to create procedure on every form ?,
No ,create a procedure with Public scope and call it anywhere you want within the project.
May 5 '08 #6

Post your reply

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