Hiding a window when a report opens

I want users to select a filter criteria on a form (Main Menu), hide the form 
and open a report maximized.  It worked well with slightly modified code and 
in other forms that I have used, but I am at a loss on how to get it to work. 
 It opens the report fine, but then the form shows up on top with a 
non-maximized report in a second window.  The report filters correctly.

    Dim stLinkCriteria As String

    If (Forms![Main Menu]!AcctBreakout = 1) Then
        DoCmd.RunCommand acCmdWindowHide
        stLinkCriteria = "[All Data].Projsub= " & [Field5]
        DoCmd.OpenReport "By Line Item2", acViewPreview
        Reports![By Line Item2].Filter = stLinkCriteria
        DoCmd.Maximize

    End If


End Sub

0
Utf
12/29/2007 11:05:01 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
749 Views

Similar Articles

[PageSpeed] 52

This is how I would do it, then on the open statement of your report,
add DoCmd.Maximize

   =A0 =A0 Dim stLinkCriteria As String
       Dim stReport As String

       stLinkCriteria =3D "[All Data].Projsub=3D " & [Field5]
       stReport =3D "By Line Item2"

 =A0 =A0
       If (Forms![Main Menu]!AcctBreakout =3D 1) Then
   =A0 =A0 DoCmd.RunCommand acCmdWindowHide
 =A0 =A0 =A0 DoCmd.OpenReport stReport, acViewPreview, stLinkCriteria
     =A0 End If

End Sub

0
magmike
12/29/2007 11:19:01 PM
Hi Scott,
one thing to check is the form's popup property.
If the form has its pop up property set to yes, it will open on top.

Jeanette Cunningham


"scott" <scott@discussions.microsoft.com> wrote in message 
news:18AA7FFD-34AE-485E-82FB-4A89F50BC62F@microsoft.com...
>I want users to select a filter criteria on a form (Main Menu), hide the 
>form
> and open a report maximized.  It worked well with slightly modified code 
> and
> in other forms that I have used, but I am at a loss on how to get it to 
> work.
> It opens the report fine, but then the form shows up on top with a
> non-maximized report in a second window.  The report filters correctly.
>
>    Dim stLinkCriteria As String
>
>    If (Forms![Main Menu]!AcctBreakout = 1) Then
>        DoCmd.RunCommand acCmdWindowHide
>        stLinkCriteria = "[All Data].Projsub= " & [Field5]
>        DoCmd.OpenReport "By Line Item2", acViewPreview
>        Reports![By Line Item2].Filter = stLinkCriteria
>        DoCmd.Maximize
>
>    End If
>
>
> End Sub
> 


0
Jeanette
12/29/2007 11:47:52 PM
Thanks.  This worked, but I had to remove the stLinkCriteria from the 
OpenReport command and put back in the Report Filter command.  The report 
would not filter records when stLinkCriteria was used as a where clause in 
the Open Report command (a syntax thing?).

I guess the trick was to put the maximize command in the Open Form 
statement.  I'm not sure why that would be and I'm pretty sure I have used 
the same command in other forms that I have used.

In any case, thanks a lot.

For Jeannette - the popup was set to no.

"magmike" wrote:

> This is how I would do it, then on the open statement of your report,
> add DoCmd.Maximize
> 
>        Dim stLinkCriteria As String
>        Dim stReport As String
> 
>        stLinkCriteria = "[All Data].Projsub= " & [Field5]
>        stReport = "By Line Item2"
> 
>     
>        If (Forms![Main Menu]!AcctBreakout = 1) Then
>        DoCmd.RunCommand acCmdWindowHide
>        DoCmd.OpenReport stReport, acViewPreview, stLinkCriteria
>        End If
> 
> End Sub
> 
> 
0
Utf
12/30/2007 1:14:00 AM
Reply:

Similar Artilces:

Filter a Report
I have a report that has two fields called "ManifestNumber" (number field) and "RecievedOn" (Date/Time). Then I have another form with two buttons. "Print New Manifest" and "Reprint A Manifest". Both of these buttons opens my report, but I like the first button, "Print New Manifest", to filter the report for "RecievedOn" field that contains todays date. The second button asks to enter a Manifest Number. Then it should match this number with the "ManifestNumber" field of the report and filter it for that number. Help! ...

Hiding "0" values in pivot table
In a worksheet I have a listing of stock records with ItemNumber, Date, StockLocation and NumberOnStock. When I make simple Pivot Table with ItemNumber and StockLocation as rows and select a Sum of "NumberOnStock" I would like to hide rows where the sum is "0". But this does not seem to be possible. Tried to follow the guidelines in the Microsoft article: http://office.microsoft.com/en-us/assistance/HP051998791033.aspx#Hide%20zero%20values%20in%20a%20PivotTable%20report But no luck :-( Mogens You could use conditional formatting on these cells - highlight the cells,...

Relationships Window '11' ??
Okay I'm not finding this any where. Access 2003 Relationships Window, one of the relationships is 11 (eleven). What does that mean? Edit Relationships shows the exact same settings as 1 : 1. Rick Just a guess ... any chance the two tables are squeezed quite close together? What happens if you pull them a bit further apart from each other? Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute end...

Slow opening across a LAN
Hi gang is it normal for there to be a significant difference in file opening times between 1/ opening excel and then opening a server based workbook from within the file menu 2/ going to the workbook on the server and double clicking differential seems to be a magnitude of 5 or 10 TIA BobH We use xl2k at work and if you start the timing with the double click event or clicking on the Open button, then I've never noticed a difference between the two methods. As a test, can you copy a file to a local harddrive and try both ways with that? (And a completely off the wall guess: Is the...

Hiding formuals in cells question
Hi. I was wondering if there was a way to hide the formulas in cells without protecting the sheet. I am making something for other teachers at my school and I want to hide the formulas so they won't mess anything up on the spreadsheet. Any help would be greatly appreciated. Thanks! Hi not without protecting the sheet but why is this a problem for you? -- Regards Frank Kabel Frankfurt, Germany "JP" <JP@discussions.microsoft.com> schrieb im Newsbeitrag news:ABFE07BF-6087-4E24-814A-03AF8863A633@microsoft.com... > Hi. I was wondering if there was a way to hide the fo...

Multiple SOP Windows
Is there a setting in version 7.5 software setup that allows one user to have more than one SOP window/document open at one time. If not this is simply very poor design. Without this ability it is very cumbersome to handle say periodic customer inquiries and at the same time work at another task such as new order entry. One should simply be able to flip from one window/document to another. -- Best Regards George You can launch another GP session; although, that will use another user license. For inquiries, could a person not use the Sales Document Inquiry to look up information? ...

hide my name
When replying to an email or creating one from scratch how do i hide my name in the "from" field...thx fred <fdbjrgetridofthis@wowway.com> wrote: > When replying to an email or creating one from scratch how do i hide > my name in the "from" field...thx Are you saying you want the reply to be anonymous? -- Brian Tillman [MVP-Outlook] no, I don't mind if my email is revealed.. just my name. I have tried by removing it from the "User Name:" field in the email account but it continues to show up. I have also removed from the header informati...

Excel opens with no document -
Where is the default document for excel when it is launched? I am looking for the normal.dot of the excel world. Symptom: When I open an excel document it launches excel.exe to a blank grey screen. When I open a new Excel document and close it the document I opened is maximized at that point. I was thinking about recreating or pointing to the default excel document if it exists. First try the usual tweaks. Reboot your system. Start Excel with Start - Run - type: excel /unregserver, then excel.exe /regserver. It will start, put in all factory default registry settings, then end. Now ...

Errors
I get the following problems in Outlook 2007 Professional new installation with Windows 7 ultimate O/S - 1) When I try to import a Personal folder from another .pst file of same Outlook 2007 version it gives me an error "The Messaging interface has returned an unknown error. If the problem persists restart Outlook". This error never goes off even after restart. 2) Trying to add new Outlook data file through Data File Management after selecting type of storage for new outlook data file as Office Outlook Personal Folders file and selecting the specific .pst file it g...

Publisher starts with Windows Installer always
I have a customer who installed MS Publisher 2000 as the local administrator. The local administrator can launch MS Publisher fine. But, when she logs in as her Domain Username, it continually starts by launching the Mini Windows Installer for Publisher and looks for DATA2 location. Even if she gives the DATA2 location and goes into Publisher THE NEXT time it does it all again....starts mini install and asks for DATA2. She points to it again and she can get to Publisher. This always happens. I'm perplexed because the administrator profile does not have this issue. I even ...

Hiding and Un-Hiding Data fields
I am using a form for people to select data via dropdown menus and then having it run through a query to filter results. Is there a way that I can have certain feilds hidden until a toggle button or something of the like is clicked? Basically I want have three choices of buttons: Year, Quarter, and Month. What I ideally want to happen is when someone selects the button for year, a hidden drop down menu appears where they can then choose from the available years to filter through the query. I would say I am above average with using access, but I have no idea how to hide fields and then...

How do I hide gaps in an Excel 2007 chart?
I have a bar chart that is showing gaps and i don't want them. The select data > hidden and empty cell button does not give an option to hide gaps. I think by default they are hidden but if you even click on this to see what it does the gaps are shown and no way to turn off. Hi, If you hide the actual rows then with the Plot visible cells only setting on the gaps will be removed. In xl2007 the setting is on the Select Data dialog, Hidden/empty cells button. Cheers Andy Waynesch wrote: > I have a bar chart that is showing gaps and i don't want them. The s...

Portability to all versions of Windows
I am writing an VC++ 6, MFC app that uses standard listviews, dialogs, DaoRecordset connecting to an Access database and Crystal Reports. I know that 2000 and XP are very similar and portability should not be an issue, but what about 98 and ME? Are there any issues that would prevent the app runing under 98 and ME? William Gower wrote: > I am writing an VC++ 6, MFC app that uses standard listviews, dialogs, > DaoRecordset connecting to an Access database and Crystal Reports. I know > that 2000 and XP are very similar and portability should not be an issue, > but what about 98...

Hide images when Hiding Rows
I have inserted images into cells, but when I hide the column the images are not hidden with that column, they just get squished between the two cells next to the hidden cell. Is there a setting or way to tie the image to that cell so that it hides/unhides appropriately with the row? -- kurt ------------------------------------------------------------------------ kurt's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=35686 View this thread: http://www.excelforum.com/showthread.php?threadid=554712 Kurt You cannot insert an image into a cell. You can overlay ...

For the record: broken Money report
M+ Deluxe Advanced Reports. Account Balance with Details report, set to show Bank Information. Header says Bank Name. In other tested cases, the Financial Institution attribute reports out in this column. In the case of Loan Accounts, the Financial Institution is not shown but the Comments attribute is. Not that it's a big deal and not that they are going to fix it, but... ...

Exporting reports to excel from Access 2007
Hi, I used to be able to export my reports in Access 2003 to Excel by selecting File => Export and choosing Excel. I have been trying to figure out how to do this in Access 2007. However, the excel icon for external data is grayed out. Is there a way to turn this functionality on. Thanks, -- Chuck W "ChuckW" <haji@hotmail.com> wrote in message news:5CF53900-52CB-4C9E-873D-A6DBAF927EDA@microsoft.com... > Hi, > > I used to be able to export my reports in Access 2003 to Excel by > selecting > File => Export and choosing Excel. I have been trying t...

Outlook 2000 and Windows XP
I recently purchased a PC running Windows XP. I installed my Microsoft Office 2000 software and set up Outlook including my e-mail accounts. On the "servers" tab I have added my password and checked "remember my password" however, EVERY TIME I send/receive I am promted for my password. If I'm not there to type it in, I get an error message and no mail. Is this a compatibility issue with XP and Outlook 2000? It's infuriating... any advice? Have you installed all of the SPs for Office? --� Milly Staples [MVP - Outlook] Post all replies to the group ...

Hiding a worksheet #3
I want to hide a worksheet. So, I went to the format menu and the "worksheet" option is grayed out. Why? And, how do I "ungray" it. Hi is your worksheet protected ? -- Regards Frank Kabel Frankfurt, Germany llong wrote: > I want to hide a worksheet. So, I went to the format menu and the > "worksheet" option is grayed out. Why? And, how do I "ungray" it. I think Frank meant to ask about the Workbook--not the worksheet. (Check under Tools|protection|Protect workbook or Unprotect workbook) My question is: Is there another sheet in the w...

Trying to Create a Security Report in Crystal.
I am trying to create a security report using Crystal. The GP reports take to long with our 70+ companies and 200+ users. We use Advance Security and I have extracted and imported into SQL a file that contains the series names, resource names, dictionary names and type names. Now when I try to link this table to the sy02000 table I get results for reports and tables but not forms. Then I ran the following search on the sy02000 table: select * from dynamics..sy02000 where dictid = 0 and restype = 1 order by resid. The only resid's that showed up were 57... 3241 rows with the o...

Storage Groups In Windows SBS 2003 R2 Premium
As I have writen above, I have Windows SBS 2003R2 Premium and would like to make 2 storage groups and then an mailbox storage in the second storage in the exchange, but I get an error massage: "The Storage group already contains the maximum number of storage allowed" ID No. c1034a7a. How do I get around that problem? Is it possible to sent from multiple domains that is running on the Exchange?? I thank you for the help! FlashBang wrote: > As I have writen above, I have Windows SBS 2003R2 Premium and would > like to make 2 storage groups and then an mailbox storage in t...

closing windows
Hi I'm using Office XP Pro under windows 2000. With multiple Excel (2002) windows open, clicking on the Close button closes all the windows while clicking on the close window button only closes that window. That seems reasonable, but in Word, clicking on the Close button only closes that wondow. Is there some setting to customise this? Thanks Brad I don't think so. Brad wrote: > > Hi > > I'm using Office XP Pro under windows 2000. With multiple > Excel (2002) windows open, clicking on the Close button > closes all the windows while clicking on the cl...

Sort Window Size
My company recently upgraded to Windows7 and Office 2007. When I use the sort command in Excel, the size of the sort window increases with each use of the command. I have to grab the edge of the popup window and resize it in order to see the work sheet. Is this a known problem with this software combination, or an installation problem? -- EWJJET My office just upgraded to Office 2007 (still Windows XP) and I've got the same problem with the sort window growing. I'm sorry I don't have an answer for you - but perhaps you've found out what the issue is by now? I...

Access 97 can't resize database window
My database window with the listings of forms tables etc was adjusted to a smaller width, but resizing it is completely disabled and renders Access 2007 utterly useless for me. Is there anyway to 'reset' the window? ...

how to hide an ActiveX control?
hi there i have an ActiveX control, written in C++, which has the OLEMISC_INVISIBLEATRUNTIME flag set, yet when i display the web page it is attached to, i get the familiar "red cross" graphic in the middle of the screen - how can i hide the control so nothing is displayed at all? tia bhu can u set the size of ur control as 1x1 pixels "bhu Boue vidya" <bhuvidya@yahoo.com.au> wrote in message news:1175703214.292931.252210@e65g2000hsc.googlegroups.com... > > hi there > > i have an ActiveX control, written in C++, which has the > OLEMISC_INVISIBLEATR...

Consecutive ma-open calls are failing with error 3051
Hello. I'm having a problem with exchange 5.5sp3 on windows NT 4.0sp6 TSE (I know, pretty old environment. The upgrade is in my todo list). I will try to explain the issue. Sometimes I get this message because space left on disk is less than 10MB: "The MTA is terminating because the disk where MTADATA is located has less than 10MB of space, or an error occurred while trying to check for free space on the disk. If disk space is low, free up some disk space and restart the MTA. NT Error code returned: 0 (non-zero indicates an error while checking for free space) [BASE IL TIMER 3] (16)&...