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!

Display custom message in place of #Error

Status
Not open for further replies.

darall

Instructor
Aug 7, 2002
32
0
0
US

I have a form with several subforms on it. Each subform is on a different Tab using the Tab control. I am pulling information from the first tab onto the second by setting the default value of the field to the control on the first tab.
Code:
(=[Forms]![frmProjectData_PM]![sfrmProjectBudget_Summary].[Form]![HI_BudgetColorID])

However, if the data is missing in the first tab I get a #Error result in my field on the second tab. I want to display a custom message like "Please complete Tab 1 prior to completing this Tab" instead of the #Error.

I have done this in Excel by doing a nested if function, so I tried it on the form but it doesn't work:

Code:
=IIf(iserror(Forms!frmProjectData_PM!sfrmProjectBudget_Summary.Form!HI_BudgetColorID),"MISSING",Forms!frmProjectData_PM!sfrmProjectBudget_Summary.Form!HI_BudgetColorID)

Can this be done in access? I also tried the ismissing function and the nz function with the same result.

 
Perhaps this ?
=Nz(Forms!frmProjectData_PM!sfrmProjectBudget_Summary.Form!HI_BudgetColorID,"Please complete Tab 1 prior to completing this Tab")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 

Thanks PHV! That didn't work but it got me to the answer! So simple, yet I have been struggling with it for days!

Code:
=IIf(IsError(Forms!frmProjectData_PM!sfrmProjectBudget_Summary.Form!HI_BudgetColorID)=-1,"Please complete Tab 1 prior to completing this Tab","")

Thank you!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top