Run-Time Error 64479

rsgriffith

Registered User.
Local time
Today, 18:21
Joined
Dec 11, 2003
Messages
15
I'm getting a run-time error when entering data in a form. See attachment.

Follow these steps:
Open DB
Go to Forms
Open frm_MainFormPage
Click on Daily Water Usage Tab

As a User enters the "Daily Meter Reading" the "Gallons Used" field is "automatically updated". I had the form working correctly on the first 3 records, let me re-phrase that, I had some help getting the form to work but something has changed and for the life of me can't figure it out....something to do with the code but heck I don't know what.

See the query: qryReading..this looks at the last two records which along with some of the code directly ties into the calculation for the "Gallons Used" field. You will see the other code once you hit the "debug button" after the error from the main form.

I've been looking at this problem for 5 hrs and would appreciate any help.
 

Attachments

Narrowed this down

Actually if I use just the frm_GroundWaterWithdrawal by itself (not the one on the "tabbed" frm_MainFormPage) it works correctly.

Still need help......

thanks
RSG
 
Ralph,

Did you get the e-mail?
 
RSG,

Change the criteria in your query to read <=[Forms]![frm_MainFormPage]![frm_GroundWaterWithdrawal]![Id]

This should do the trick.

Cheers

Flyer
 
Got It

Hi dan-cat and Flyer,

Dan the changes you sent me earlier worked great...I have several other tables and forms to create in which I take adapt the statements to them also...hopefully I can work my way through them.

Flyer, would like to thank you also for your reply, the changes you suggested were exactly what dan-cat had emailed me earlier.

Just for the benefit of others that use the forum board and to make sure "I" fully understand the "statement changes" I'll try to interpret them, please correct me if I'm wrong.

The original statement was only looking only at the last 2 records in the "frm_GroundWaterWithdrawal" which was:

<=[Forms]![frm_GroundWaterWithDrawal]![Id]

Correct???

Since I 'm actually entering the data for the "frm_GroundWaterWithDrawal" via the "frm_MainFormPage"
the statement was changed to have the query look at the last 2 records via the "frm_MainFormPage":

<=[Forms]![frm_MainFormPage]![frm_GroundWaterWithdrawal].[Form]![Id]

Correct???

Heck, I think I confused myself with all that :-)

again thanks for the "support" and thanks for the "forum"
RSG
 
RSG,

Not exactly.

Your original statement looked for the Id field on the open form frm_GroundWaterWithdrawal (which wasn't actually open itself).

The revised statement referenced the Id field correctly, i.e. through the main form and then the subform which is a control on the former.

Cheers

Flyer
 
I believe Mr Flyer has it covered ;)
 

Users who are viewing this thread

Back
Top Bottom