>Thanks for helping
>
>I can't seem to get it...let me tell you exactly what i am trying to do, please be patient as i have never done any VB before now.
>
>I have a module with a function 'Call_form'.
>I have declared a global variable called ldDate in the declarations section of the module.
>The function 'call_form' calls a form called 'frmGetDate'-(frmGetDate.Show vbModal).
>There is a maskedit box where the date is entered by the user.
>The form is released and the line of code just after to form was called in the 'call_form' function is 'ldDate = frmGetDate.MaskEdBox1.Text' but I realise the value of the maskedbox1 is no longer in scope.
>Please tell me what i am doing wrong as it is unclear to me.
>
>Thanks
>
>Nicky
On a first form, place a command button and add this code:
Private Sub Command1_Click()
MsgBox Form2.AskSomething
End Sub
On a second form, place a command button, a textbox and add this code:
Private strText As String
Private Sub Command1_Click()
Unload Me
End Sub
Public Function AskSomething() As String
Me.Show vbModal
AskSomething = strText
End Function
Private Sub Text1_LostFocus()
strText = Text1.Text
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com