Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-07-2019, 02:42 PM   #1
kirkm
Newly Registered User
 
Join Date: Oct 2008
Posts: 760
Thanks: 28
Thanked 24 Times in 24 Posts
kirkm is on a distinguished road
Can't find field. Error 2465

From a button click event I'm trying to debug print the value of a field
Code:
debug.print Form_frmList!FileSpec
If I put a Stop in the code and paste that line into the immediate window there is not error and the correct value is shown.
Why does it go to error in the click event ?
The field does exist in the query the Form is based on, but there is no control for that field on the Form. But this is true for some other fields in the query yet I can debug.print them.

kirkm is offline   Reply With Quote
Old 12-07-2019, 02:45 PM   #2
theDBguy
I’m here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 7,246
Thanks: 63
Thanked 1,678 Times in 1,633 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Can't find field. Error 2465

Hi. Is the button on frmList or a different form?
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 12-07-2019, 02:56 PM   #3
kirkm
Newly Registered User
 
Join Date: Oct 2008
Posts: 760
Thanks: 28
Thanked 24 Times in 24 Posts
kirkm is on a distinguished road
Re: Can't find field. Error 2465

The button is on the Main Form and frmlist is there also but as a datasheet. A subForm? (this confuses me a bit)

kirkm is offline   Reply With Quote
Old 12-07-2019, 02:58 PM   #4
theDBguy
I’m here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 7,246
Thanks: 63
Thanked 1,678 Times in 1,633 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: Can't find field. Error 2465

Quote:
Originally Posted by kirkm View Post
The button is on the Main Form and frmlist is there also but as a datasheet. A subForm? (this confuses me a bit)
What is the name of the main form?
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 12-07-2019, 02:59 PM   #5
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,919
Thanks: 120
Thanked 3,324 Times in 3,000 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Can't find field. Error 2465

Debug.Print Me.filespec if on the same form

Or

Debug.Print Forms!frmList.FileSpec if on another form

Or

Debug.Print Me.frmList.Form.FileSpec if on a subform
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)

Last edited by isladogs; 12-07-2019 at 03:06 PM.
isladogs is offline   Reply With Quote
Old 12-07-2019, 03:28 PM   #6
kirkm
Newly Registered User
 
Join Date: Oct 2008
Posts: 760
Thanks: 28
Thanked 24 Times in 24 Posts
kirkm is on a distinguished road
Re: Can't find field. Error 2465

Many thanks for the replies. I'm sorry this is the sort of thing that drives me crazy. I've spent over 2 hours on this and suddenly it starts working. I've done nothing to fix it.


Trying Colins examples here doesn't seem to work. Is this a clue of some kind?

Debug.Print Forms!frmList.FileSpec
error 2450 Microsoft Access cannot find the referenced form 'frmList'.
Debug.Print Me.frmList.Form.FileSpec
Method or data member not found (with .frmList highlighted)


Debug.Print Form_frmList!FileSpec
This is now working every time.
kirkm is offline   Reply With Quote
Old 12-07-2019, 03:40 PM   #7
isladogs
High Noon Moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 11,919
Thanks: 120
Thanked 3,324 Times in 3,000 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Can't find field. Error 2465

How you need to reference a control will depend on where you are calling it from

If its in a subform, you need to reference the name of the subform control.

See http://access.mvps.org/Access/forms/frm0031.htm


__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Colin (Mendip Data Systems)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Common sense and a sense of humour are the same thing, moving at different speeds. (Clive James - RIP)
isladogs 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
[SOLVED] Error '2465' can't find the field '|1' ikzouhetnietweten Modules & VBA 1 11-19-2015 11:26 AM
Run-time error '2465' can't find the field '|1' referred to in your expression princessdmb Modules & VBA 3 07-29-2015 09:12 AM
Runtime error '2465' : can't find the field '|1' referenced gblack Modules & VBA 1 03-17-2014 07:55 AM
Error 2465 'Access can't find the field..... Peter Bellamy Modules & VBA 6 10-07-2010 05:49 AM
Runtime Error 2465 can't find the field (MS Acess 2003) patelr26 Forms 2 07-25-2008 10:40 AM




All times are GMT -8. The time now is 12:03 AM.


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 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World