Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to use Dlookup to retrieve data from Qry to my Frm 1

Status
Not open for further replies.

RobertIngles

Technical User
Jan 20, 2011
113
CA
Hi all;

I am trying to retrieve an aggregate value from a query into a form. I initially tried to use the aggregate (count) in the query that the form is based on however it made the form fields uneditable.

I have a table of users and apps. The count qry is to calculate how many users are using a particular app (QRY_AppV_Apps_User_Count). The form is for tracking testing progress but I want to be able to prioritize tasks according to the number of users for the app. I used the built in statement assistant in Access and it came up with what you see below however it returns a value of "#Name?". In searching for a solution I have tried DLookup statemets using the =" & Forms with no luck.

Qry is called:QRY_AppV_Apps_User_Count
Fields include: CountOfUser and Master App Name
Field value to be retrieved is: CountOfUser

Form is called: FRM_AppV_Test_Status_Remediation
Field on Form that needs to match is: Master_App_Name


=DLookUp([QRY_AppV_Apps_User_Count]![CountOfUser],[QRY_AppV_Apps_User_Count],[QRY_AppV_Apps_User_Count]![Master App Name]=[Master_App_Name])

and:

=DLookUp([QRY_AppV_Apps_User_Count]![CountOfUser],[QRY_AppV_Apps_User_Count],[QRY_AppV_Apps_User_Count]![Master App Name]=[Forms]![FRM_AppV_Test_Status_Remediation]![Master_App_Name])

Can anyone offer any suggestions?

Thanks everyone!!
 
If the control is on the form [FRM_AppV_Test_Status_Remediation] then you should be able to use:
Code:
=DLookUp("CountOfUser","QRY_AppV_Apps_User_Count", "[Master App Name]='" & [Master_App_Name] & "'")
All of the arguments in DLookup() are strings.



Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top