![]() |
|
|
Welcome to the { mindfrost82.com } forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Need Help about Form and subform
Dear All,
I try to write VBA to display data from when I click a record in datasheet subform to textbox in form. I try to write some code on On_current( ) event as form.text1 = subform.text1 it doesn't work. Please give me suggestion. Thank you, March |
|
|||
|
Re: Need Help about Form and subform
On Mon, 11 Aug 2008 09:24:31 -0700, March <March@discussions.microsoft.com>
wrote: >Dear All, > >I try to write VBA to display data from when I click a record in datasheet >subform to textbox in form. I try to write some code on On_current( ) event as > >form.text1 = subform.text1 > > >it doesn't work. > >Please give me suggestion. > >Thank you, > >March > The syntax for referring to a control on a subform is a bit peculiar. It does not use the name of the Form object in the subform at all, instead it uses the Name property *of the Subform control* on the mainform. To make matters even more confusing, Access will often use the same name for both objects - the container and the contents. In code on the mainform use the Me! shortcut to refer to the current form: Me!text1 = Me!subformcontrol.Form!text1 Note that this will pull the value of the currently selected subform record (perhaps one of many) into the mainform. This is *probably* a bad idea; could you explain why you feel that you need to do this? -- John W. Vinson [MVP] |
![]() |
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|