Solved Access result apperance

Springblossom

Member
Local time
Today, 17:14
Joined
Jan 18, 2022
Messages
55
Hello.

The final result does not show in the report queries.
Could you please help with finding out what could the problems be in these cases?
 
It might help if you could post the SQL statement for your query as well as a sample set of your data and the expected result from it.
 
I think we need to see your tables in design view and the relationships, as from the field names I think you have some design issues.
Year and Month are both reserved names in Access, and they should simply be displayed if required extracted from a single date field.
 
What is the row source for the Employee Combo box?
 
Lets see the select query / row sources of the three controls.

Employeename
projectname
activitycategory
 
=DLookup("CostCenter","Employees", "ID = " & Nz([EmployeeName], 0))
 
To explain - @arnelgp post
Your combo box is storing the Employee ID, not the name. This is the correct way to do this, but you then need to make sure you look up the ID - not the name.

As a bit of advice, I would change any ID field names to EmpID or similar, as if you have 10 tables with ID fields you won't know what ID you are referring to...
 
I think an image of the design view of your query is needed, did you click to show a column in the query or not?
 
when I enter an employee name, I have a result but if the employee is empty then it says #error.
 
that is why you need to write:

Nz([EmployeeName], 0))
 
is this what you have?

=DLookup("CostCenter","Employees", "ID = " & Nz([EmployeeName], 0))
 
1642510541938.png


This is the message I get when I enter that code.
 
sorry you need to use semicolon:

=DLookup("CostCenter"; "Employees"; "ID = " & Nz([EmployeeName]; 0))
 

Users who are viewing this thread

Back
Top Bottom