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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox Error

Status
Not open for further replies.

bigfigkid

Programmer
Feb 18, 2003
26
0
0
CA
Hi Everyone !
Happy Holidays ...

I have an access form which has in particular a textbox and subform. The subform is comprised from a query, and the textbox references a field in the subform.

Everything works fine, until at which time I have no results in the subform, and the textbox gives me #Error.

I have tried inserting code in the parent forms onActivate event, testing if the subform isnull, and isempty, but to no avail. Maybe I'm going about this the wrong way, but I'm looking for some input on how to handle this.

Thanks much ...
 
How are ya bigfigkid . . . . .

Is the [blue]Textbox[/blue] on the main or subform?

Post the [blue]ControlSource[/blue] for the textbox.

Calvin.gif
See Ya! . . . . . .
 
textbox is on main form.

=[qryTRANSFER subform].Form!SumOfWALLEYETRANSFER

 
bigfigkid . . . . .

In the [purple]ControlSource[/purple] try:
Code:
[blue]=Nz([qryTRANSFER subform].Form!SumOfWALLEYETRANSFER, 0)
[purple][b]or[/b][/purple]
=Nz([qryTRANSFER subform].Form!SumOfWALLEYETRANSFER, "")[/blue]

Calvin.gif
See Ya! . . . . . .
 
for some reason the nz function still yields an #Error.

This error only happens when the field I reference in the subform contains no records. The subform is derived from a query.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top