Ra Fe,
Hi! Just saw your post. It seems like you want to return a value from one form to another. Instead of MainForm.Text1=SubForm.Text2 you could also write your code to call the SubForm as a function like:
MainForm.Text1=SubForm.GetValue()
Where GetValue would be a public function in SubForm which would look something like:
Public Function GetValue() as Integer (or what ever data type you want)
SubForm.Show vbModal
GetValue = RetVal
End Function
As soon as this function is called it launches your SubForm as modal. Before you close your form, you must transfer the value entered in Text2 into a variable (RetVal) which you have to declare at the top of your code in the General Section.
When SubForm closes the value in RetVal is returned to the calling program where you can do with it as you wish as in...
if MainForm.Text1 = 0 Then...
Hope this does the trick 8 )
Happy New Year!!!
Martin
Shit happens!!!