Error 2465 'Access can't find the field..... (1 Viewer)

Peter Bellamy

Registered User.
Local time
Today, 04:55
Joined
Dec 3, 2005
Messages
295
I am getting this error when I try to update a control on a form from a control on an open subform.

The subform has a button which open this new form and in a GotFocus event I have the following code:
Code:
If IsNull([inspect_equipno]) Then
     Me.equipno = Forms![Call Entry]![Equipment Record].Form![serialno]
End If

That is newform.controlname = Forms!formname!subformname!Form.subformcontrolname

I have looked over and over and cannot see what the error is.
All the names are correct, I am puzzled! :confused:
 

JANR

Registered User.
Local time
Today, 05:55
Joined
Jan 21, 2009
Messages
1,623
Nothing wrong with your syntax so probably you have spelling error or your subformConteiner name is not "Equipment Record"

I'v tried it and it works on my samplebase.

Just a word of caution, if your subfom is a continious form or datasheet whats beeing passed is the first record on your subform

JR

Edit: Make sure that [serialno] actually are present on your subform.
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 04:55
Joined
Jan 22, 2010
Messages
26,374
Perhaps Peter can tell us which line is actually being highlighted?

Hard to tell which field it can't find from just looking at the code. It could inspect_equipno, equipno, equipment record or serialno.
 

Peter Bellamy

Registered User.
Local time
Today, 04:55
Joined
Dec 3, 2005
Messages
295
I thought it must be a spelling mistake but I cannot find it!
It is complaining about the Me.equipno line and says it can't find the FILE 'Equipment Record'

peter
 

vbaInet

AWF VIP
Local time
Today, 04:55
Joined
Jan 22, 2010
Messages
26,374
Ok, there's a difference between the name of the subform control and the subform. What you're referring to is the subform name, however, you should be referring to the subform control. The subform control is called Call Record. I know this because I can tell this is based on the db you attached in one of your posts.

To get the name of a subform control, click on it once, and look in the name property. Double clicking goes to the form, clicking once goes to the control that houses the form.
 

Peter Bellamy

Registered User.
Local time
Today, 04:55
Joined
Dec 3, 2005
Messages
295
Thanks you are right except it is 'Equipment Record' the Form but its control name is just 'Equipment'. Correcting that fixed it.

I'll try to be more consistant in future!

Peter
 

vbaInet

AWF VIP
Local time
Today, 04:55
Joined
Jan 22, 2010
Messages
26,374
Oh I see you've changed the names. On the naming convention front, that's your first ever db of 9 years ago so you're excused:p
 

Users who are viewing this thread

Top Bottom