PC Review


Reply
Thread Tools Rate Thread

Change control in dialog form

 
 
RobGMiller
Guest
Posts: n/a
 
      7th Jun 2010
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
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      7th Jun 2010
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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
control Windows dialog box from database form Rondy Microsoft Access Form Coding 7 30th Mar 2009 11:30 PM
How I get control over dialog that opened from my form? mtczx232@yahoo.com Microsoft Dot NET Framework Forms 1 16th Dec 2006 01:08 PM
change control property on inherited form from base form ajwalters@gmail.com Microsoft Dot NET Framework Forms 1 20th Apr 2006 03:37 PM
How to change form.control.name =?Utf-8?B?SGFycnkgSA==?= Microsoft Access VBA Modules 1 24th Nov 2004 04:13 AM
Change Form Control text on User Control Steven K Microsoft ASP .NET 1 19th Aug 2004 07:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:46 PM.