[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

error 2471

Posted on 2012-04-12
4
Medium Priority
?
327 Views
Last Modified: 2012-04-30
thisis a  validation i try to do in Access form

i do not know why it give me error 2471 in the form


If Me.amount > DLookup("totalvalue", "po_1", "[PO_oracle]= " & Form_GR_trans.POoraclenum)
0
Comment
Question by:mmously
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 37837129
Try this - NZ handles cases where there are no matches by returning 0 instead of null:

If Me.amount > NZ(DLookup("totalvalue", "po_1", "[PO_oracle]= " & Form_GR_trans.POoraclenum),0)

Open in new window

Ot if PO Number is text enclose it in quotes:

If Me.amount > NZ(DLookup("totalvalue", "po_1", "[PO_oracle]= '" & Form_GR_trans.POoraclenum & "'"),0)

Open in new window

Jim Dettman has an EE Article that does a very good job of explaining the DLookup function here:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_12-Dlookup-and-the-Domain-Functions.html
0
 

Author Comment

by:mmously
ID: 37837157
hi  mbizup

it does not work it turn ren , i used the one related to text po
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37837185
Make sure it is all on one line:
If Me.amount > NZ(DLookup("totalvalue", "po_1", "[PO_oracle]= '" & Form_GR_trans.POoraclenum & "'"),0)

Open in new window


Also try this:

If Me.amount > NZ(DLookup("totalvalue", "po_1", "[PO_oracle]= " & chr(34) & Form_GR_trans.POoraclenum & chr(34)),0)

Open in new window



If your PO number can contain single quotes, the first will fail..
0
 
LVL 61

Accepted Solution

by:
mbizup earned 2000 total points
ID: 37837232
Also, since you are starting this with IF, i'm assuming you have a corresponding Then:

If Me.amount > NZ(DLookup("totalvalue", "po_1", "[PO_oracle]= '" & Form_GR_trans.POoraclenum & "'"),0) Then

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question