Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:30:32+00:00 2026-06-09T20:30:32+00:00

I have been looking for some time now, but I can’t see the problem

  • 0

I have been looking for some time now, but I can’t see the problem here:

Option Compare Database
Option Explicit

Private Sub cmd_Refresh_Click()

Dim sSQL_Select                     As String
Dim Qdb                             As Database
Dim Qry                             As QueryDef    

sSQL_Select = "SELECT * FROM T_TIME_SCHEDULE"

Set Qdb = CurrentDb
Set Qry = Qdb.CreateQueryDef("QTS", sSQL_Select)
DoCmd.OpenQuery "QTS", acViewNormal
Me.F_Child_Result.Form.RecordSource = "QTS"
Me.F_Child_Result.Requery

Qdb.QueryDefs.Delete ("QTS")
Set Qdb = Nothing

End Sub

This line:

Me.F_Child_Result.Form.RecordSource = "QTS"

results in the following error:
Run-Time error ‘2467’: The expression you entered refers to an object that is closed or doesn’t exist.
The syntax should be correctly constructed, and I double checked the name of the subform.
Desipte, the error remains.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:30:33+00:00Added an answer on June 9, 2026 at 8:30 pm

    Do not set the record source to a query, just the SQL string.

    sSQL_Select = "SELECT * FROM T_TIME_SCHEDULE"
    
    ''Set Qdb = CurrentDb
    ''Set Qry = Qdb.CreateQueryDef("QTS", sSQL_Select)
    ''DoCmd.OpenQuery "QTS", acViewNormal
    Me.F_Child_Result.Form.RecordSource = sSQL
    ''Me.F_Child_Result.Requery
    

    There is no need to requery, the form will be requeried when the record source is changed.

    Note that even if you could set the record source to a query (which you can’t), it would not be quoted.

    FROM Chat

    It appears that there are two mixed strands in the question. What is required is a means to set the Source Object of the subform control to a query, not the Record Source of a form contained by the subform control.

    The source object can be set like so:

    Me.F_Child_Result.SourceObject="Query." & sQueryName
    

    If the Source Object is already set to the name of a saved query that is used only for this form, there is no need to reset it, you can just modify the sql of the query:

    Set qdf = CurrentDB.QueryDefs("JunkQuery")
    qdf.SQL = sSQL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking around for some time now, but can't seem to find
I have been looking for an answer to this problem for some time now
I have been looking for an answer for some time now, hope you could
I have been looking for some time for this and I can't seem to
I have been looking on the web for some time now and HTML5 local
I have been looking online for some time now to make sure there was
I have searched StackOverflow for some time now, but have not been successful so
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
Hi i have been looking for some solutions but i have found nothing... Is
I've been looking for a software synthesizer in AS3 for quite some time now,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.