473,322 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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.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
2 1584
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nikki | last post by:
I am fairly new to Access so please be patient. What I would like to do is have a form with a subform to work like a pos system. When I scan a barcode it brings up the info associated with the...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
3
by: Nicolae Fieraru | last post by:
Hi All, I have a problem and I can't figure out how to solve it. My database has three tables: tblCustomers, with CustomerId and CustomerName tblProducts, with ProductId and ProductCode...
0
by: Tom Lee | last post by:
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-...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
1
by: dBNovice | last post by:
Please help! I have 3 forms: Task, Subtask, Elements. Elements is a subform of Subtask and Subtask is a subform of Task. I am able to navigate from Task to Subform to Element and from Element to...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
13
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
4
theaybaras
by: theaybaras | last post by:
Hi everyone, You've all been such a huge help to me since joining, and I'd just like to take a second to let you know how much I appreciate it! That said, I have another supplication! ;) I have...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.