Are you always wanting to set the value of the same control on the dialog
form?
Open the form using:
DoCmd.OpenForm "NameOfForm", acNormal, , , , acDialog, "SomeValue"
then in the Load event of the form, use
Private Sub Form_Load()
If IsNull(Me.OpenArgs) = False Then
Me!SomeTextbox = Me.OpenArgs
End If
End Sub
If you're trying to have the dialog form refer to a value on the form that's
opening it, you can simply use
Private Sub Form_Load()
Me!SomeTextbox = Forms!NameOfOtherForm!NameofControl
End Sub
--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
Co-author: Access 2010 Solutions, published by Wiley
(no e-mails, please!)
"RobGMiller" <(E-Mail Removed)> wrote in message
news:245C5D5C-C77B-4C2A-A5E0-(E-Mail Removed)...
> Using Access 2003.
>
> Using VBA to change the content of a text control on a dialog form. (The
> form is opened from another form using doCmd.FormOpen ,,,,, acDialog)
>
> The value of the control will change from the form Open by simply using
> ControlName = "New text" or Me.ControlName.Value = "New text"
>
> This does not work from a function located in the form vba code.
> --
> RobGMiller