?
Solved

Change the sourceobject of subform to a new recordset

Posted on 2003-11-08
4
Medium Priority
?
668 Views
Last Modified: 2008-01-09
Hi,

I have a subform. i want to change the sourceobject of the subform to a new recordset. In other words i want to show the records from a new recordset in the subform. But when i tried to change the sourceobject of subform it gave me an error "the setting you entered isn't valid for this property".  Is there any way to do so.
My emailid is agarwalp@lucent.com
0
Comment
Question by:pradeep_no1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 1000 total points
ID: 9706713
For example; in the click event of a button on the main form:
Us e you own names for mysubformctl, and your own sql statement.


Dim strsql
strsql = "Select * from mytable where thisfield >5"
me.mysubformctl.form.recordsource = strsql

Pete
0
 
LVL 2

Expert Comment

by:JethroUK
ID: 9707034
or if you have already defined the queries to use on a subform:


recordsource = "MyQuery"
requery 'repopulate the form with the new data
0
 
LVL 39

Expert Comment

by:stevbe
ID: 10025070
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: peter57r {http:#9706713}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

stevbe
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question