If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Command from Form to change Record Source of Report
I'm using VB to change the SQL Record Source of my Sub Form on my Main
form. On my main form I also have a Command Button that opens a report. What command could I use to set the Record Source of my report, rpt_SEARCH Thanks Jeff |
#2
|
|||
|
|||
Command from Form to change Record Source of Report
Could you limit the report with the WhereCondition of OpenReport?
Example: If your subform is limiting the records where the InvoiceDate is in the last 3 months, you could: Dim strWhere As String strWhere = "[InvoiceDate] = DateAdd(""m"", -3, Date())" DoCmd.OpenReport "Report1", acViewPreview, , strWhere -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "orbojeff" wrote in message oups.com... I'm using VB to change the SQL Record Source of my Sub Form on my Main form. On my main form I also have a Command Button that opens a report. What command could I use to set the Record Source of my report, rpt_SEARCH Thanks Jeff |
#3
|
|||
|
|||
Command from Form to change Record Source of Report
orbojeff wrote:
I'm using VB to change the SQL Record Source of my Sub Form on my Main form. On my main form I also have a Command Button that opens a report. What command could I use to set the Record Source of my report, rpt_SEARCH Thanks Jeff Unless you want to open the report in design view (not a good idea), the only place the RecordSource of a Report can be changed is with code in the Open event of that report. It cannot be changed "from the outside" like you can with a Form. Your form can either pass information to the Report so the Report's code knows what to do, or you can have the Report's code "look back" at the Form to determine what it should do. -- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
strategy for data entry in multiple tables | LAF | Using Forms | 18 | April 25th, 2005 04:04 AM |
Help!! I'm running around in circles! | CathyA | New Users | 19 | December 12th, 2004 08:50 PM |
dlookup | miaplacidus | Using Forms | 9 | August 5th, 2004 09:16 PM |
Display Parameter from Form on Report | sara | Setting Up & Running Reports | 10 | July 19th, 2004 04:54 PM |