Need help about return value from Module Function

  • Thread starter Thread starter March
  • Start date Start date
M

March

Hello,

I'm new to write VBA code. I have written a code to convert date in my owned
format. I write the code in Module. For example

Sub pDFunction(ByVal pD As String)
....
....
....

pD

End Sub


In a form

I create a textbox for user input value of "pD".

Once i hit button


Private Sub Command0_Click()

CDTxt = Format(CDTxt, "mm/dd/yyyy")
Call pDFunction(CDTxt)

End Sub

With Call pDFunction(CDTxt) is working well. But I don't know how to return
the value of "pD" at the end of the Module showing in another textbox in my
form.

Please give me suggestion.

March
 
March,
try this:

Private Sub Command0_Click()

CDTxt = Format(CDTxt, "mm/dd/yyyy")
Me.txtNewControl = pDFunction(CDTxt)

End Sub

replace txtNewControl with the name of the other textbox on your form.


Jeanette Cunningham
 
Back
Top