Solved

Dlookup

Posted on 2013-02-06
11
447 Views
Last Modified: 2013-02-06
Hello, I just cant seem to get my head around this. I have it working in one form but then using the same syntax it does not work in another. Please help.
Ideally i want to lookup to criteria to then get me result but am just trying to get it working using one criteria.

=DLookUp("[rftotal]","[ringfencedstock]","[offerref]=" & [Forms]![offermain]![ref])

rftotal is a numeric field

Thanks for any help.
Iain
0
Comment
Question by:iainmacleod
  • 4
  • 3
  • 3
11 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
i don't see anything wrong with your dlookup

did you check the name of the fields and controls

if [offerref] is text

=DLookUp("[rftotal]","ringfencedstock","[offerref]='" & [Forms]![offermain]![ref] & "'")
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 250 total points
Comment Utility
The important datatype here is offerref.

If that is text...

=DLookUp("[rftotal]","[ringfencedstock]","[offerref]='" & [Forms]![offermain]![ref] & "'")
0
 

Author Comment

by:iainmacleod
Comment Utility
Thank you both, you were spot on. The offerref is text. I have added what you sent and that works a treat. Could you also help me with the second critera,

And "[stockcode]='" & [Forms]![offermain]![offersubform]![stockcode] & "'"

Many thanks
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Try this:

=DLookUp("[rftotal]","[ringfencedstock]","[offerref]='" & [Forms]![offermain]![ref] & "' And [stockcode]='" & [Forms]![offermain]![offersubform]![stockcode] & "'")

Open in new window

0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
try this


=DLookUp("[rftotal]","ringfencedstock","[offerref]='" & [Forms]![offermain]![ref] & "' and [stockcode]='" & [Forms]![offermain]![offersubform]![stockcode] & "'")
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:iainmacleod
Comment Utility
That is excellent, thanks very much. I now have a great template for future....
0
 

Author Comment

by:iainmacleod
Comment Utility
I hope i have done the right thing with the points...?
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
;-)
0
 
LVL 61

Expert Comment

by:mbizup
Comment Utility
Iain -

Since that second question was not really part of the original post, perhaps an even point split would be more equitable (right now, I've got the lion's share)?  I can fix that for you if  you want... (or use the Request Attention button)
0
 

Author Comment

by:iainmacleod
Comment Utility
If you could fix that I would appreciate it. You have both helped me out in the past as well... - thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now