Go Back   Access World Forums > Microsoft Access Discussion > Reports

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-24-2019, 01:48 AM   #1
dzgr
Newly Registered User
 
Join Date: Jun 2019
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dzgr is on a distinguished road
Talking <solved>DLookup in a report doesn't work when put the report in a navigation form

Good morning everyone,

I am new to Access and to the forum. I've attempted to use a DLookup as a control source in a report like this:

=DLookUp("txtVehicleName","tblVehicle","VehicleID= " & [Reports]![rptMountingPosition]![Vehicle_FKID])

It works well when I open the report direktly from the left navigation pane. But thing became weired when I creat a navigation form and put this report into it. It does not work any more, only shows a "#Name?" error message.

Is there anyone could give me a hand?

Thanks very much.


Last edited by dzgr; 06-24-2019 at 03:39 AM. Reason: solved
dzgr is offline   Reply With Quote
Old 06-24-2019, 01:57 AM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,909
Thanks: 40
Thanked 3,538 Times in 3,419 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: DLookup in a report doesn't work when put the report in a navigation form

I presume by
Quote:
creat a navigation form and put this report into it
you mean you are displaying the report via a subform. In which case please clarify how you did this - by dragging the report onto the navigation form? or some other way?

In which case this

[Reports]![rptMountingPosition]![Vehicle_FKID]

needs to be something like

[navigationformname].[nameofsubformcontrol].form![Vehicle_FKID]
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is online now   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
dzgr (06-24-2019)
Old 06-24-2019, 03:18 AM   #3
dzgr
Newly Registered User
 
Join Date: Jun 2019
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dzgr is on a distinguished road
Re: DLookup in a report doesn't work when put the report in a navigation form

Hello CJ_London,

Thanks for your hints. I dragged the report onto the navigation form, just like many tutorial said. And I'v followed your hins change the control source like this:

=DLookUp("txtVehicleName","tblVehicle","VehicleID= " & [Forms]![frmNavigation]![NavigationSubform].[Form]![Vehicle_FKID])

This time the error message became #Type! .... what could be the reason?

Thanks a lot.

dzgr is offline   Reply With Quote
Old 06-24-2019, 03:26 AM   #4
dzgr
Newly Registered User
 
Join Date: Jun 2019
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dzgr is on a distinguished road
Re: DLookup in a report doesn't work when put the report in a navigation form

I've also googled the same problem. It seems not be a Null/Zero or data format problem...so strange....
dzgr is offline   Reply With Quote
Old 06-24-2019, 03:38 AM   #5
dzgr
Newly Registered User
 
Join Date: Jun 2019
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dzgr is on a distinguished road
Re: DLookup in a report doesn't work when put the report in a navigation form

Oh man, I solved it by changing the code like this:

=DLookUp("txtVehicleName","tblVehicle","VehicleID= " & [Vehicle_FKID])

Unbeliveble, it's so that simple.

dzgr is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing parameters to report doesn't work ryetee Modules & VBA 1 02-23-2015 10:46 AM
Report Printing doesn't work the first time KACJR Reports 1 05-09-2014 10:52 PM
Report to RTF file doesn't work hvtran Reports 4 08-11-2008 06:22 PM
Report Code doesn't work - any suggestions?? sportsguy Reports 1 12-28-2004 10:12 AM
Combo Box Navigation doesn't work cable Forms 3 04-18-2002 07:21 AM




All times are GMT -8. The time now is 03:09 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World