By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,917 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,917 IT Pros & Developers. It's quick & easy.

Subform Question. Please help!

P: n/a
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.value = 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

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Tom Lee wrote:
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.value = 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?


-----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!ControlName

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:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQtlpM4echKqOuFEgEQK88QCfavA03TIJCl5q6/0mem7coHd35MAAnAtA
IsZ5tMxManIoUCNUnOLLdOWm
=Zr1N
-----END PGP SIGNATURE-----
Nov 13 '05 #2

P: n/a
Tom Lee wrote:
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.value = 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?


-----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!ControlName

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:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQtlpM4echKqOuFEgEQK88QCfavA03TIJCl5q6/0mem7coHd35MAAnAtA
IsZ5tMxManIoUCNUnOLLdOWm
=Zr1N
-----END PGP SIGNATURE-----
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.