J
jer99 via AccessMonster.com
I have a modal dialog box that I call from a function.
The dialog box instead of closing, makes itself invisible.
The function, after the dialog box makes itself invisible, gets the value of
the text field and returns it.
It looks like this:
Function NewNameDialog(sForm As String) As String
Dim sReturn As String
DoCmd.OpenForm sForm, WindowMode:=acDialog
sReturn = Forms!newnamefrm.txtNewName
<<<<<<<==========
DoCmd.Close acForm, sForm
NewNameDialog = sReturn
End Function
I would like it to look like this:
Function NewNameDialog(sForm As String, sField as string) As String
Dim sReturn As String
DoCmd.OpenForm sForm, WindowMode:=acDialog
sReturn = Forms!newnamefrm.sfield
<<<<<<<==========
DoCmd.Close acForm, sForm
NewNameDialog = sReturn
End Function
Obviously, this is the wrong syntax. Could someone help out? Or is it
impossible.???
Jerry
The dialog box instead of closing, makes itself invisible.
The function, after the dialog box makes itself invisible, gets the value of
the text field and returns it.
It looks like this:
Function NewNameDialog(sForm As String) As String
Dim sReturn As String
DoCmd.OpenForm sForm, WindowMode:=acDialog
sReturn = Forms!newnamefrm.txtNewName
<<<<<<<==========
DoCmd.Close acForm, sForm
NewNameDialog = sReturn
End Function
I would like it to look like this:
Function NewNameDialog(sForm As String, sField as string) As String
Dim sReturn As String
DoCmd.OpenForm sForm, WindowMode:=acDialog
sReturn = Forms!newnamefrm.sfield
<<<<<<<==========
DoCmd.Close acForm, sForm
NewNameDialog = sReturn
End Function
Obviously, this is the wrong syntax. Could someone help out? Or is it
impossible.???
Jerry