[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Access - DLookup in Query?

Posted on 2007-11-19
1
Medium Priority
?
433 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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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 how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

834 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