473,320 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Open report to last page

I open a report with a button on a form and I'd like to have the report
open to the last page. I tried using sendkeys and it works when I
manually open the report from Reports on the msaccess screen, but when
I use the button on the form the report opens to the first page. It
looks like the problem there is that the sendkeys command is processed
before the report opens, so the sendkeys command is focused on the form
and not on the report so the report just opens to the first page.
Anyone know a solution for this?
Thanks.

Nov 3 '06 #1
5 6623
Did you try setting the Wait argument to Yes for SendKeys?

--
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.

"rinmanb70" <em**********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
>I open a report with a button on a form and I'd like to have the report
open to the last page. I tried using sendkeys and it works when I
manually open the report from Reports on the msaccess screen, but when
I use the button on the form the report opens to the first page. It
looks like the problem there is that the sendkeys command is processed
before the report opens, so the sendkeys command is focused on the form
and not on the report so the report just opens to the first page.
Anyone know a solution for this?
Thanks.

Nov 3 '06 #2
Yes. This is the code I tried:

DoEvents
SendKeys "{End}", True
DoEvents

I tried it both on the report's open event and on the form button's
click event.

I originally tried it without the True. Obviously that didn't work
either.

Nov 3 '06 #3
This works for me:

DoCmd.OpenReport "Report1", acViewPreview
SendKeys "{End}", True

--
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.

"rinmanb70" <em**********@gmail.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Yes. This is the code I tried:

DoEvents
SendKeys "{End}", True
DoEvents

I tried it both on the report's open event and on the form button's
click event.

I originally tried it without the True. Obviously that didn't work
either.

Nov 3 '06 #4
Thanks for your feedback. I have found that after I open the report
with the form's button I can press the End key on my keyboard and
nothing happens. If I then use the mouse to click the next page or
last page button then the End key does work after that.
Make sense?
Any ideas?

Nov 3 '06 #5
Dunno what else to suggest, as I am not able to see the problem here.

I tried a report with over 300 pages, and it worked fine.

--
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.

"rinmanb70" <em**********@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
Thanks for your feedback. I have found that after I open the report
with the form's button I can press the End key on my keyboard and
nothing happens. If I then use the mouse to click the next page or
last page button then the End key does work after that.
Make sense?
Any ideas?

Nov 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin | last post by:
Hi, I have an Access 97 report that mimics an official UK Covernment Customs document, with Page Headers and Footers presenting static data for each page (logos etc). The report is made up...
46
by: Steve | last post by:
Access97 Database The database is split into a frontend and backend and not connected to any other database. The database has an unbound report with 15 subreports. Some of the subreports include...
3
by: Grim Reaper | last post by:
I know this is probably an easy question, but I could not find/figure it out. Basically, I am printing mailing labels with a "Sorting/Grouping" section that groups the label types together....
0
by: Aaron Hartley | last post by:
Hi, I created a report in Access. * The report has 4 labels per page. Label here means the report is printed multiple times per page, not the label object type. * Each label uses 75 numbers,...
2
by: Geoff collishaw | last post by:
I'm trying to create a form where: (a) The user is given a list or Reporting Services reports in a listbox (b) When the user clicks on a button, then these reports are opened in SEPARATE windows....
1
by: Tim Frawley | last post by:
I have created a Crystal Report with five subreports to represent datagrids on our dataentry application. The largest datagrid is the last item on the report. When empty this last subreport will...
13
by: Greg | last post by:
Most suggestions on this topic recommend to use a page footer and make it visible only on the last page. My problem is that the footer is half of the height of a page which means the detail would...
0
by: rinmanb70 | last post by:
I open a report with a button on a form and I'd like to have the report open to the last page. I tried using sendkeys and it works when I manually open the report from Reports on the msaccess...
1
by: littlbit755 | last post by:
I am using Access 2003 at work and had created a summary report showing the financial information for year to date. As of last week the report ran great. Today I was asked to make a change in the...
2
by: Steve | last post by:
I'm working on a report for an existing database. The report will be a directory of over 500 employees and thus multiple pages. What do I need to do to show the first employee and the last employee...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.