Accessing field on remote form indirectly

  • Thread starter jer99 via AccessMonster.com
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top