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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Recordsource of a Data Access Page?

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
How do I programmatically change the Recordsource of a Data Access page?
 
If none of these help, please be more specific in what you are doing.

Controls Are Not Automatically Rebound After You Change the RecordSource Property

How to Determine the Record Source of a Data Access Page

Filtering code:
<SCRIPT language=vbscript event=onclick for=btnFind>
<!--
' Clone the recordset.
Dim rs
Set rs = MSODSC.DataPages(0).Recordset.Clone

On error resume next
' This line assumes that the value you are filtering on is an integer.
' If the search value is a string, use slightly different syntax.
rs.find "CustomerID = '" & CStr(InputBox("Please enter customer to find", "Find")) & "'"
rs.find "ProductID=" & cLng(inputbox("Enter a ProductID","Find"))

' Custom error handling.
If (err.number <> 0) Then
Msgbox "Error: " & err.number & " " & err.description,, _
"Invalid Search"
Exit Sub
End If

' Check search results for success.
If (rs.bof) or (rs.eof) Then
Msgbox "No Product found",,"Search Done"
Exit Sub
End If

MSODSC.DataPages(0).Recordset.Bookmark = rs.Bookmark
-->
</SCRIPT>
 
I appreciate your response, but that's not what I was looking for. Here's what I have.

I have a data access page (Employee.htm) whose Recordsource is based on a stored procedure. This page is loaded within an iframe within another page (Page1.htm)

I have created another page (Page2.htm) that loads the same page (Employee.htm) in an iframe. Consequently, when the page (Employee.htm) is loaded, I need to determine the name of the page that is hosting the iframe. If Page1.htm is hosting the iframe, then the RecordSource for Employee.htm needs to be one stored procedure. If Page2.htm is hosting the iframe, then the RecordSource for Employee.htm needs to be another stored procedure.

So, my question is, how do I change the RecordSource programmatically?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top