Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Change the sourceobject of subform to a new recordset

Posted on 2003-11-08
4
Medium Priority
?
676 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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
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…

604 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