I created a form in VB called DemogInfoForm and would like to know how I can
pass the value entered from a text box to a module? The instructions are on
the "command OK" button. The value will also be used to gather other
information from the mainframe. Here is what I got so far...

Sub OkButton_Click()

On Error GoTo Err_Command

Me.CaSEText.SetFocus

If Len(Me.CaSEText.Text) <> 10 Then 'Message that wrong number
of digits entered for case number MsgBox "Please enter the 10-digit Case
Number." _ & vbCrLf _ & " Please try again!", vbCritical, "10-digit Number
Error Message"
Exit Sub
Else

'Once the value is verified, I would like to pass the value to the
CaseNUMFind module .... thank you

CaseNUMFind (Number) 'Go to module

Re: Passing Values to a Module by Jonathan

Jonathan
Mon Apr 07 14:14:28 PDT 2008

Hi Tom

You might find this article helpful

"How to cut out repetition and write much less code, by using subroutines
and functions that take arguments"
http://www.word.mvps.org/FAQs/MacrosVBA/ProcArguments.htm


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

"TomP" <TomP@discussions.microsoft.com> wrote in message
news:DC0C642F-F330-4490-9A96-11C52A9907A6@microsoft.com...
>I created a form in VB called DemogInfoForm and would like to know how I
>can
> pass the value entered from a text box to a module? The instructions are
> on
> the "command OK" button. The value will also be used to gather other
> information from the mainframe. Here is what I got so far...
>
> Sub OkButton_Click()
>
> On Error GoTo Err_Command
>
> Me.CaSEText.SetFocus
>
> If Len(Me.CaSEText.Text) <> 10 Then 'Message that wrong number
> of digits entered for case number MsgBox "Please enter the 10-digit Case
> Number." _ & vbCrLf _ & " Please try again!", vbCritical, "10-digit Number
> Error Message"
> Exit Sub
> Else
>
> 'Once the value is verified, I would like to pass the value to the
> CaseNUMFind module .... thank you
>
> CaseNUMFind (Number) 'Go to module
>