VB UI loses display of record when report generated 
Author Message
 VB UI loses display of record when report generated

Hi,

Hope you can help

I've created a Form that provides a simple ADO interface to a simple Access
database. The form features  navigation buttons and a 'print report button'.
The report is generated via the DataReports facility.

When I fire up the app, the first record displays and I can navigate through
the records no problem. When I click the report button it executes a
sub-routine with the following single instruction:

rptContact.Show

The report is generated; again no problem.

However, when I close the report and return to the UI, there is no record
displayed. It is neccessary to use the navigation buttons to display a
record (which works).

Ideally I would want the record that was displayed when the report was
generated to remain displayed. Failing that I would be happy with the first
record being displayed.

I've tried making use of AbsolutePosition, BookMark, setting focus on the
Form, Adding a .MoveFirst method call after the .ShowReport... All to no
avail - Though it is more than possible that I wasn't using them correctly.

Thanks in advance for your help
Andy



Wed, 02 Feb 2005 00:34:06 GMT  
 VB UI loses display of record when report generated
Just in case I've left you scratching your heads, I thought I'd better let
you know I've sorted it.

The original data report was based on a DataSource which was based on an
Access TABLE.

I continued the development of my app and found that, for a reason that
remains a mystery to me, the report now failed to display (I did receive an
error message along the lines "Incorrect DataSource for report Sections").
As I tried to figure out why this was I found a reference in a book to
creating reports with Report Designer - it suggested a QUERY for the source,
not a TABLE.

Tried it and hey-presto it works!

Would still be interested to know why a table caused the original problem
though.

Andy

Quote:
> Hi,

> Hope you can help

> I've created a Form that provides a simple ADO interface to a simple
Access
> database. The form features  navigation buttons and a 'print report
button'.
> The report is generated via the DataReports facility.

> When I fire up the app, the first record displays and I can navigate
through
> the records no problem. When I click the report button it executes a
> sub-routine with the following single instruction:

> rptContact.Show

> The report is generated; again no problem.

> However, when I close the report and return to the UI, there is no record
> displayed. It is neccessary to use the navigation buttons to display a
> record (which works).

> Ideally I would want the record that was displayed when the report was
> generated to remain displayed. Failing that I would be happy with the
first
> record being displayed.

> I've tried making use of AbsolutePosition, BookMark, setting focus on the
> Form, Adding a .MoveFirst method call after the .ShowReport... All to no
> avail - Though it is more than possible that I wasn't using them
correctly.

> Thanks in advance for your help
> Andy



Thu, 03 Feb 2005 01:45:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Need to display multiple lines mini report within one record in a report

2. Checking for 0 records returned before generating report

3. UI - display delay

4. UI displays differently on diff sized screens

5. generate multiple records from 1 record

6. Display the First 10 records of a Query/Report only

7. Display count of records in a report?

8. Please Help: Printing a Report based on currently displayed records in a form

9. Report showing BOTH Aggregate Sum of Display records and Total Sum by Group

10. VB.Net Dataset loses records across functions

11. Losing part/all of sound recording using MCI32.OCX under VB 4.0

12. Losing part/all of sound recording using MCI32.OCX under VB 4.0

 

 
Powered by phpBB® Forum Software