RE: Text box values in user forms



Hello,
Here are the two routines, one is straight from a book I have that I would
like to modify if I could only get it to work. The message box keeps
erroring out and saying that there is no variable declared.

Thank you very much for your help.
_______________________________________
Option Explicit
Dim rng As Range
Dim sText As String

Sub StartSig()
frmSignature.Show
End Sub

Sub ChooseSig()

MsgBox sTextFill
End Sub



(This is the user form)
Public sTextFill As String
Option Explicit

Sub cmdAddSig_Click()
Me.Hide
Dim stSigText As String
sTextFill = Me.txtName.Text
Signature.ChooseSig
End Sub

Private Sub cmdCancel_Click()
Unload Me
End Sub

"Joanne" wrote:

> I'm sorry to appear to thick, but how do I transfer the value of a text box
> that is in a user form to a routine that is in another procedure? I keep
> getting an error that the variable is not set but it is!
>
> Thanks very much.
.



Relevant Pages

  • Project Error
    ... Private Declare Sub Sleep Lib "Kernel32" ... Dim strDataSrc As String ...
    (microsoft.public.vb.bugs)
  • Re: Is there a way to prevent a RichTextBox from scrolling?
    ... Private _isRegex As Boolean ... Public Sub New(ByVal thispattern As String, ... Dim entry As tDict ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Excel Listing tool using VB
    ... Sub ListFiles2() ... Dim directories() As String, CurrentDirectory As String ... Dim dirtopaste, dirok ...
    (microsoft.public.vb.general.discussion)
  • Form Error
    ... SMSDS_CallerID As String ... Private Declare Sub Sleep Lib "kernel32" ... Dim ComString As String ... Dim AppPath As String, FreeFileNo% ...
    (microsoft.public.vb.bugs)
  • Re: Encrypt/hide Password
    ... Public Sub New(ByVal strCryptoName As String) ... ' instantiated crypto class. ... Dim fsKey As New FileStream(strSaveToPath, FileMode.OpenOrCreate, _ ...
    (microsoft.public.scripting.wsh)