Subform Question. Please help!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom Lee

    #1

    Subform Question. Please help!

    Dear All,

    I am trying to put together a small homemade accounting database and
    have encountered the following problems, hope you guys can help:

    1) I have a subform which includes 3 columns- vochure number (more like
    parent record number), credit field and debit field. My objective is to
    create a warning box and lock user within the subform if the total sum
    of the credit doesn't equal to the total sum of the debit field within
    that master record. I would like to know if anyone can give me a small
    piece of sample code.

    2) I also have a date field within the parent form. I want to change
    the date field within the subform equal to the parent field "on
    active". However, when I place the code there, which looks something
    like...
    me.subform.form .datefield.valu e = ddate (ddate is a public storage
    variable)
    the datefield would give me a time value, let say 12:03AM instead of a
    date value. Does anyone know why?

    Thanks for your help,

    Tom

  • MGFoster

    #2
    Re: Subform Question. Please help!

    Tom Lee wrote:[color=blue]
    > Dear All,
    >
    > I am trying to put together a small homemade accounting database and
    > have encountered the following problems, hope you guys can help:
    >
    > 1) I have a subform which includes 3 columns- vochure number (more
    > like parent record number), credit field and debit field. My
    > objective is to create a warning box and lock user within the subform
    > if the total sum of the credit doesn't equal to the total sum of the
    > debit field within that master record. I would like to know if anyone
    > can give me a small piece of sample code.
    >
    > 2) I also have a date field within the parent form. I want to change
    > the date field within the subform equal to the parent field "on
    > active". However, when I place the code there, which looks something
    > like... me.subform.form .datefield.valu e = ddate (ddate is a public
    > storage variable) the datefield would give me a time value, let say
    > 12:03AM instead of a date value. Does anyone know why?[/color]

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    1. Usually you can use the Form BeforeUpdate event to check if
    everything is OK before saving the record. If everything is NOT OK then
    just show a MsgBox & set Cancel = True. The record won't be saved.

    2. Refer to controls on other forms in this manner:

    Me!SubFormName! ControlName

    or

    Me!SubFormName. Form!ControlNam e

    The last one explicitly indicates that the SubFormName is a form.

    Use ! to separate collection items from their objects - Me is the object
    (the form) and the ControlName is the collection item in the form's
    default collection, Controls.
    --
    MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
    Oakland, CA (USA)

    -----BEGIN PGP SIGNATURE-----
    Version: PGP for Personal Privacy 5.0
    Charset: noconv

    iQA/AwUBQtlpM4echKq OuFEgEQK88QCfav A03TIJCl5q6/0mem7coHd35MAAn AtA
    IsZ5tMxManIoUCN UnOLLdOWm
    =Zr1N
    -----END PGP SIGNATURE-----

    Comment

    • MGFoster

      #3
      Re: Subform Question. Please help!

      Tom Lee wrote:[color=blue]
      > Dear All,
      >
      > I am trying to put together a small homemade accounting database and
      > have encountered the following problems, hope you guys can help:
      >
      > 1) I have a subform which includes 3 columns- vochure number (more
      > like parent record number), credit field and debit field. My
      > objective is to create a warning box and lock user within the subform
      > if the total sum of the credit doesn't equal to the total sum of the
      > debit field within that master record. I would like to know if anyone
      > can give me a small piece of sample code.
      >
      > 2) I also have a date field within the parent form. I want to change
      > the date field within the subform equal to the parent field "on
      > active". However, when I place the code there, which looks something
      > like... me.subform.form .datefield.valu e = ddate (ddate is a public
      > storage variable) the datefield would give me a time value, let say
      > 12:03AM instead of a date value. Does anyone know why?[/color]

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      1. Usually you can use the Form BeforeUpdate event to check if
      everything is OK before saving the record. If everything is NOT OK then
      just show a MsgBox & set Cancel = True. The record won't be saved.

      2. Refer to controls on other forms in this manner:

      Me!SubFormName! ControlName

      or

      Me!SubFormName. Form!ControlNam e

      The last one explicitly indicates that the SubFormName is a form.

      Use ! to separate collection items from their objects - Me is the object
      (the form) and the ControlName is the collection item in the form's
      default collection, Controls.
      --
      MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
      Oakland, CA (USA)

      -----BEGIN PGP SIGNATURE-----
      Version: PGP for Personal Privacy 5.0
      Charset: noconv

      iQA/AwUBQtlpM4echKq OuFEgEQK88QCfav A03TIJCl5q6/0mem7coHd35MAAn AtA
      IsZ5tMxManIoUCN UnOLLdOWm
      =Zr1N
      -----END PGP SIGNATURE-----

      Comment

      Working...