|
-
May 15th, 2000, 06:14 AM
#1
Thread Starter
Hyperactive Member
I need to change one of two things with code in a formula in MSAccess 2000 - either the SQL of a Query or the RecordSource of a Report. Unfortunately I can not figure out how to reference the query in code, and when I try to change the RecordSource of the Report, I get the error that I cannot reference or set a value of an object that does not have the focus.
Any hints would be greatly appreciated.
Thank you
Andrew
-
May 15th, 2000, 01:13 PM
#2
What EXACTLY are you trying to do? To change the recordset for a report put something like this in the Report_Open event of the report or if you are subclassing just include events and then do it.
Me.Recordsource="SELECT * FROM [My Table]"
That is something simple, it depends what you are trying.
-
May 15th, 2000, 08:57 PM
#3
Thread Starter
Hyperactive Member
That is the basic idea. I have the report's datasource set to a query to begin with, and in a field "LastName" in the query I have the filter criteria
Like[Enter the beginning of the last name:] & "*"
so that when the user opens the query a window appears that prompts them to enter the first letters of the last name. At another place in the program I need to be able to directly pass the LastName parameter without prompting the user for input. I can change the recordsource in the ReportOpen routine like you said, but the window still appears prompting the user for input.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|