[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

pass dlookup value to a text field.

Posted on 2004-11-07
4
Medium Priority
?
160 Views
Last Modified: 2008-02-20
experts, here's my code for the afterupdate event Combo0 in my form and after update I have a blank field for textbox "PM".

Private Sub Combo0_AfterUpdate()
Me.pm = DLookup("Hours", "qr", "Forms![Form1].[Group]='PM")
Me.Requery
End Sub

the requery is to run query "qr" whose criteria depends on the value of the above combo box.


Am I doing something similar to a circular formula here? If so, please help
0
Comment
Question by:mc7560
2 Comments
 
LVL 12

Accepted Solution

by:
pique_tech earned 500 total points
ID: 12518918
Your criteria is not quite right.

You have the first two parts right, but you have to tell Access which field in the query qr you want to set the criteria on.  So you should have something like:

DLookup("Hours","qr","SomeFieldIn_qr=" & forms!Form1!Combo0)

If that doesn't help, post here with some more details, in particular the SQL from query qr and the field you want to filter it by.
0
 
LVL 34

Expert Comment

by:Mike Eghtebas
ID: 12519081
' is missing from 'PM'

Me.pm = DLookup("Hours", "qr", "PM = '" & Forms![Form1].[Group] & "'")
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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…
Suggested Courses

873 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