Set value from popup form in subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm trying to do this:

When pushing a button in a subform, a popup appears. Within the popup the
user choose a number. Then the popup should close and the number be
transformed
to a field in the subform.

trying to do it like this:
[forms]![master].[sub]![sub_field] = new value

But it is not working.
Any hint?
 
Try:

[Forms]![Master]![Sub].Form![Sub_Field]

Note that Sub above is the name of the subform container on form Master that
contains the subform. It may or may not be the same name as the form that's
being used as a subform. If you created the subform by dragging a form on
top of form Master, then the control should have the same name. However, if
you clicked on the subform control in the toolbar and added it to the form
that way, it'll be named something like Child0.

Check out http://www.mvps.org/access/forms/frm0031.htm for a good reference
on this topic.
 
Thanks for your answers. Actually the problem wasn't the sub, but a global
variable I declared.

I moved the value from the popup field into a global variable and then

[forms]![master].[sub]![sub_field] = global_var.

Although the global_var was filled (I checked in the debugger), the value
was showing up only after
me.dirty
me.requery.

Now with

[forms]![master].[sub]![sub_field] = [forms]![my_popup]![my_field]

it is working fine.

The problem is solved, but a new one:
Why is the global variable value not accepted. Strange behaviour.


Thanks again.

Jokobe

Douglas J Steele said:
Try:

[Forms]![Master]![Sub].Form![Sub_Field]

Note that Sub above is the name of the subform container on form Master that
contains the subform. It may or may not be the same name as the form that's
being used as a subform. If you created the subform by dragging a form on
top of form Master, then the control should have the same name. However, if
you clicked on the subform control in the toolbar and added it to the form
that way, it'll be named something like Child0.

Check out http://www.mvps.org/access/forms/frm0031.htm for a good reference
on this topic.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


jokobe said:
Hi,
I'm trying to do this:

When pushing a button in a subform, a popup appears. Within the popup the
user choose a number. Then the popup should close and the number be
transformed
to a field in the subform.

trying to do it like this:
[forms]![master].[sub]![sub_field] = new value

But it is not working.
Any hint?
 
Back
Top