?
Solved

Access - DLookup in Query?

Posted on 2007-11-19
1
Medium Priority
?
426 Views
Last Modified: 2010-05-19
Hi,
Is there anyway to look up a value from a text field on one of my forms from a query? I dont know if this can be done via DLookup or something? An example would be;

Select DateUpdated from tblDate Where DateUpdated = #Forms!frmAddData!TextDate.Value#

Thanks
0
Comment
Question by:andyb7901
[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
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 20311447
Your command is essentially correct but it needs adjusting depending on where you are running the query,
If this is a saved query you can omit the # #.

If you are using it for a recordset in code then you need something like:

dim strsql
strsql = "Select DateUpdated from tblDate Where DateUpdated = #" & Forms!frmAddData!TextDate.Value & "#"
set rs = db.openrecordset(strsql)

If you still can't sort it out then post back and explain what you are trying to do.



0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

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…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

762 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