469,072 Members | 1,840 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,072 developers. It's quick & easy.

I get error code 2467 when trying to reference a subform

Seth Schrock
2,957 Expert 2GB
I have a main form that has two subforms. In the main form's OnLoad event I have code that references both subforms to set their allow additions, edits, and deletions to true or false depending on certain criteria.
Expand|Select|Wrap|Line Numbers
  1. With Me.sfrmEarlyDisclosures.Form
  2.     .AllowEdits = False
  3.     .AllowAdditions = False
  4.     .AllowDeletions = False
  5. End With
  6.  
  7. With Me.sfrmAppraisals.Form
  8.     .AllowEdits = False
  9.     .AllowAdditions = False
  10.     .AllowDeletions = False
  11. End With
For some reason, I get error code 2467 - "The expression you entered refers to an object that is closed or doesn't exist" when running line 1, but not line 7. Neither subform has records (yet), so that isn't the difference. At first I thought that maybe the subforms didn't load until after the main form's OnLoad event, but then line 7 wouldn't work either. I'm not sure what else to look for setting wise to make it work.
Apr 5 '13 #1
2 1182
Seth Schrock
2,957 Expert 2GB
UPDATE

I did further testing and it still doesn't work (same error) in the main form's OnCurrent event.
Apr 5 '13 #2
Seth Schrock
2,957 Expert 2GB
Fixed it. I missed transferring that table over to the new BE. Since there was no recordsource for the form, it didn't load the form and therefore the .Form didn't exist.
Apr 5 '13 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by kscdavefl | last post: by
3 posts views Thread by Russ | last post: by
1 post views Thread by יוני גולדברג | last post: by
2 posts views Thread by ticars | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.