Run-time Error 2465: Access can't find the field 'sfrLeave' referred to in your expr. (1 Viewer)

Dorpicasso

New member
Local time
Today, 12:34
Joined
Jan 26, 2012
Messages
1
I am an intermediate user of Access and know next to nothing about VBA. After modifying an existing subform in my database, I started getting run-time error '2465' every time I try to open The form which contains that subform.

When I click 'debug' it opens the VBA environment and shows exacltly where the "sfrLeave" is referred to in the code, but I don't know how to fix it and am afraid I will make more damage. :confused:

Can anyone help me? Can this problem be fixed without messing with the VBA?

Big thanks in advance,

D.
 

nanscombe

Registered User.
Local time
Today, 11:34
Joined
Nov 12, 2011
Messages
1,082
Is the Subform called "sfrLeave" and the subform control on the main form called "sfrLeave" as well?

If they both have the same name it may cause problems.
 

boblarson

Smeghead
Local time
Today, 04:34
Joined
Jan 12, 2001
Messages
32,059
Is the Subform called "sfrLeave" and the subform control on the main form called "sfrLeave" as well?

If they both have the same name it may cause problems.
Actually nanscombe that is an incorrect statement. In this case it actually makes it EASIER if both are named the exact same thing. If they are named different then you have to remember to use the subform CONTROL name when referring to it in code PLUS you have to add the .Form. part between it and anything you are referring to on the form (property, method, or control). If they are named the same you don't.

So, Dorpicasso - if they are not named the same, you can either name them the same (the subform control is the control on the parent form which DISPLAYS the subform and is not the subform itself), or you can refer to the subform like:

Me.SubformControlNameHere.Form.TextboxAsExample
 

nanscombe

Registered User.
Local time
Today, 11:34
Joined
Nov 12, 2011
Messages
1,082
OK, my mistake, just clutching at straws. :eek:


Any more text for that 'Error 2465' message that might help to narrow it down? :confused:
 
Last edited:

Users who are viewing this thread

Top Bottom