Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime Error 2467 - object does not exist.

Status
Not open for further replies.

pdldavis

Technical User
Oct 29, 2001
522
US
Hello, I have a Time Entry Form that has a subform which is unlinked. There are a series of buttons on the main form that build the subform recordsource based on the user selection. This worked well and something has happened.

What happens now is when the user makes his selection, the 2467 error about the subform not existing displays.

However, if I go to design view and then back to form view the subform works and updates as it should. If I close the form, open another form and come back to the time form the problem repeats itself.

If I log off and then back on as another person and run through the routine it errors again. If I go to design view and then back to form view it works fine.

This is the code. Red is the error:

Private Sub FrameItemType_AfterUpdate()

stSqlTR 'Function to Create subform Recordsource
Forms!frmTime.frmTimeSub.Form.RecordSource = stSqlTR
Forms!frmTime.frmTimeSub.Form.Requery
Me.frmTimeSub.Visible = True

End Sub

I've tried removing the subform and putting it back - same problem. Any suggestions on this?

 
Try
dim frmSubForm as New Form

Set frmSubForm = Forms!frmTime.frmTimeSub


stSqlTR 'Function to Create subform Recordsource
frmSubForm.RecordSource = stSqlTR
frmSubForm.Requery
Me.frmTimeSub.Visible = True


 
You also might want to change

Set frmSubForm = Forms!frmTime.frmTimeSub

to

Set frmSubForm = Forms!frmTime!frmTimeSub
 
Hi, thanks for the response. I am now getting a type mismatch 13 on:

Set frmSubForm = Forms!frmTime!frmTimeSub - with and without the exclamation mark after frmTime.

Not sure what is mismatched, but it doesn't like the statement.

Thanks, Dan
 
Set frmSubForm = Forms!frmTime!frmTimeSub.Form

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top