Error in code driving me crazy!

subwoofer

Registered User.
Local time
Today, 20:17
Joined
Mar 6, 2007
Messages
22
Hey all

I am having a severe HEADACHE trying to figure out what is wrong with a function I have written, so any tips/solutions to help me solve my problem will be VERY much APPRECIATED!

Problem:

I have a function that will validate data based on pre defined checks, that I have incorparated into my program, and this works quite fine. However the problem arises if a form (page) contains subforms. If it does, then it will check how many subforms and then validate each row of the subform, by recalling the function that it is called from.

This is the part of the code which contains the problem:
SubFormData.Form.Recordset.MoveFirst
Do Until SubFormData.Form.Recordset.EOF

vSubFormsOK = RunSinglePageEditChecks(PageNo, True, SubNo, Y)

SubFormData.Form.Recordset.MoveNext
Loop

After it has validated the first row, it returns but does not validate the second row of the subform, it instead gives the error message : 'An error has occured whilst validating the page. The particular error is application-defined or object defined error'. At this point all validation then stops.

Any ideas what is wrong with the do loop, or why this problem may be occuring.

Note: SubFormData is a object.

Thanks in advance!
 
Hello subwoofer!

You can't to do MoveNext on Form, but on the TABLE.
Look at "DemoMoveNextA2000.mdb",
adapt it on your task.
 

Attachments

Hey MStef,

You can use MoveNext for the forms recordset i.e. FormName.Recordset.MoveNext

At any rate thanks for your example and the reply - much appreciated! :)
 
Last edited:
Hey,

Dont worry - FINALLY found the solution - and it worked using SubFormData.Form.Recordset.MoveNext!!! :D Just had to play with the code a little!!!
 
Hello subwoofer!

You are right, it works. I didn't work this on this way,
I always us a update query (on table) for a such things.
My congratulation.
 

Users who are viewing this thread

Back
Top Bottom