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
Solved

Change the sourceobject of subform to a new recordset

Posted on 2003-11-08
4
658 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
4 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 250 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

808 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