Re: executing a subform's subroutine from the main form



Make sure the subform procedure is Public. Then in the main form, use:

Me.order_header_subform.Form.Totals

David Gartrell wrote:
Hi Everyone,

Wonder if someone could help. Basically I have a main form called
'Order_header' and within it a subform called 'order_header_subform'.
Attached to the subform I have a subroutine I've written called 'Totals'.

What i'd like to be able to do is to call the subform's 'totals' subroutine
from the main form but am unsure of the correct syntax. I have tried:
[Forms]![order header]![order_header_subform].totals

But without success. If anyone could point me in the right direction with
this then i'd be very grateful.

Many thanks

David.

--
Message posted via http://www.accessmonster.com

.



Relevant Pages

  • goto next record in a datasheet
    ... I am trying to create a subroutine that will loop through a recordset of ... items and add them to a new record in a subform in datasheet mode. ...
    (microsoft.public.access.formscoding)
  • Where to start?
    ... I am unfamiliar with programming in VBA. ... However I have the need to create a subroutine that takes information from a ... subform, compares the data with data held in a table and prints ...
    (microsoft.public.access.modulesdaovba)
  • Passing fieldname to a subroutine
    ... I have a form with a subform. ... which I am assigning links to documents on the file server. ... subroutine to pass the field name parameters to. ... tried many formats and syntaxes for this with no success. ...
    (comp.databases.ms-access)
  • Re: executing a subforms subroutine from the main form
    ... David Gartrell wrote: ... Attached to the subform I have a subroutine I've written called 'Totals'. ... this then i'd be very grateful. ...
    (microsoft.public.access.forms)
  • calling a mainform subroutine from a subform
    ... I want to call that routine from the doubleclick event of a control ... I can't figure out the syntax to call that subroutine from the subform. ... Private Sub weldletter_DblClick ...
    (microsoft.public.access.forms)

Loading