Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Refresh main form control when subform exited ?

Geek News

Refresh main form control when subform exited ?
mscertified 11/17/2008 4:21:01 PM
I have a main form containing a subform.
The subform lists checks received and when a new check is entered a 'balance
due' control on the main form needs to be adjusted. I'm having a hard time
getting this to happen. There only seems to be an 'enter' or 'exit' event for
the subform and neither seems to be of much use.
Does anyone know how to do this? Thanks.
RE: Refresh main form control when subform exited ?
Beetle 11/17/2008 5:26:03 PM
You should have a calculated control in your subforms footer, i.e.
txtBalance, that calculates the balance, and the control on your main
form should have a control source of;

=[YourSubformControlName].[Form]![txtBalance]

If you use the above method, you shouldn't need to do anything to
refresh the data in the main forms control. Make the calculated control
in the subform invisible if you don't want to see it there.
--
_________

Sean Bailey


"mscertified" wrote:

[Quoted Text]
> I have a main form containing a subform.
> The subform lists checks received and when a new check is entered a 'balance
> due' control on the main form needs to be adjusted. I'm having a hard time
> getting this to happen. There only seems to be an 'enter' or 'exit' event for
> the subform and neither seems to be of much use.
> Does anyone know how to do this? Thanks.
RE: Refresh main form control when subform exited ?
mscertified 11/17/2008 6:17:02 PM
That's exactly what I have and the value in the main form does not refresh
until you click in a control on the main form.
If the user presses the print button before doing this it prints the form
with the wrong amount.
I need the amount value to refresh as soon as you move from the amount field
in the subform.

"Beetle" wrote:

[Quoted Text]
> You should have a calculated control in your subforms footer, i.e.
> txtBalance, that calculates the balance, and the control on your main
> form should have a control source of;
>
> =[YourSubformControlName].[Form]![txtBalance]
>
> If you use the above method, you shouldn't need to do anything to
> refresh the data in the main forms control. Make the calculated control
> in the subform invisible if you don't want to see it there.
> --
> _________
>
> Sean Bailey
>
>
> "mscertified" wrote:
>
> > I have a main form containing a subform.
> > The subform lists checks received and when a new check is entered a 'balance
> > due' control on the main form needs to be adjusted. I'm having a hard time
> > getting this to happen. There only seems to be an 'enter' or 'exit' event for
> > the subform and neither seems to be of much use.
> > Does anyone know how to do this? Thanks.
RE: Refresh main form control when subform exited ?
mscertified 11/17/2008 6:39:02 PM
I did some more checking and here is what happens...
If you enter a new row in the subform and then go to enter another row, the
main form updates with the first row.
If you delete a row in the subform, the main form value updates immediately.
However, if you enter a single new row in the subform and then go back to
the main form, no update occurs until you click in a control.

-Dorian

"mscertified" wrote:

[Quoted Text]
> That's exactly what I have and the value in the main form does not refresh
> until you click in a control on the main form.
> If the user presses the print button before doing this it prints the form
> with the wrong amount.
> I need the amount value to refresh as soon as you move from the amount field
> in the subform.
>
> "Beetle" wrote:
>
> > You should have a calculated control in your subforms footer, i.e.
> > txtBalance, that calculates the balance, and the control on your main
> > form should have a control source of;
> >
> > =[YourSubformControlName].[Form]![txtBalance]
> >
> > If you use the above method, you shouldn't need to do anything to
> > refresh the data in the main forms control. Make the calculated control
> > in the subform invisible if you don't want to see it there.
> > --
> > _________
> >
> > Sean Bailey
> >
> >
> > "mscertified" wrote:
> >
> > > I have a main form containing a subform.
> > > The subform lists checks received and when a new check is entered a 'balance
> > > due' control on the main form needs to be adjusted. I'm having a hard time
> > > getting this to happen. There only seems to be an 'enter' or 'exit' event for
> > > the subform and neither seems to be of much use.
> > > Does anyone know how to do this? Thanks.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net