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!

DLookUp results in #Error for new record 2

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
0
0
ZA
In Access 2000 I am using Dlookup in an unbound text box in a record on a continuous form
However, this results in an "#Error" in the new record row. How can I suppress this?
 
Presumably you are using something on the lines of:

DlookUp("x","y","z=" & Me.txtZ)

If so, add an Nz:

DlookUp("x","y","z=" & Nz(Me.txtZ,0))

Choose a value that can never occur for Z, zero is usually suitable.
 
How are ya TimTDP . . .

Could be a number of things, so:
Microsoft said:
[blue]#Error? or #Name? appears in a control on a form or report.

#Error? or #Name? may appear in a control for a number of reasons. To correct the problem, do the following:

[ol][li]Make sure that the field specified in the control's ControlSource property hasn't been removed from the underlying table or other record source.[/li]
[li]Check the spelling of the field name in the control's ControlSource property.[/li]
[li]If you specified an expression in the control's ControlSource property, make sure that there is an equal sign preceding the expression.[/li]
[li]Make sure that there are brackets around references in expressions to control or field names that include spaces. For example, to subtract a Shipped Date field from a Required Date field, enter the following expression: =[Required Date]-[Shipped Date].[/li]
[li]If you are using one of the built-in functions, make sure that you're using the right number of arguments, that the arguments are in the right order, and that you haven't left out any necessary punctuation. To determine the correct syntax to use, see the Help topic for the function you're using.[/li]
[li]If you are referring to another control, make sure that you're using the correct syntax. For more information on referring to controls, click .[/li]
[li]Make sure that there isn't a circular reference to a control. For example, if you specify MyControl in the Name property of a control, and then type =[A]++[MyControl] in the ControlSource property box for the control, Microsoft Access can't process the expression. [/li][/ol][/blue]


Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top