Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2427 error with subform

Status
Not open for further replies.

supanoods

Programmer
Jun 6, 2002
68
0
0
GB
Guys,

I have a form/subform setup where the main form uses a child subform to check if a 'code number' has already been changed. The subform is based on a query, and if the code selected from the parent is not present on the child form, then I get the 2427 runtime error due to NULL value.

I totally understand why its generating the error, the question is how do I get past it. I want a text box on the main form to return "n/a" if the null condition occurs, otherwise populate with the value found on the child form.

If this is not clear then I can try and explain more if necessary!

Thanks in advance.

Cheers, Supanoods B-)
"If it aint broke - dont fix it!
 
Oh forgot to say, i am thinking about trying an err.number =...then... routine, to IGNORE the error, but I am aware that this is not best practice - or is this the only way???

Cheers, Supanoods B-)
"If it aint broke - dont fix it!
 
How is the setup of your two tables involved, and how did you link your main and child form...


Pampers [afro]
Keeping it simple can be complicated
 
I have decided to alter the way in which I was doing this altogether. The main form was reading one .xls file, where the child form was reading an other. I was getting the error because when the child forms source was reading the .xls file and there was a NULL record entry, I was getting the runtime error.

I have changed the child's source file to a .csv, now rather than an .xls file. This way what was a NULL entry found at the source, is now seen as an ZERO value. I can handle that better!

I think that makes sense! (its late and I've a had a bad day!)

Cheers, Supanoods B-)
"If it aint broke - dont fix it!
 
How are ya supanoods . . .

Is this happening when you first open the form?

Be aware . . . a form with subform(s) [blue]opens from the inner most nested subform out to the mainform[/blue]. [purple]So any mainform data needed by the subforms isn't loaded yet![/purple]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top