Solved

DataReport Refresh not Working

Posted on 2001-08-28
3
226 Views
Last Modified: 2008-02-01
I am using Datareport to produce some simple Reports.
I am leaving the DataEnvironment1 Open while the program is running.
1..I display the DataReport
2..Enter new items in a form, these entries display immediately in that forms list box's etc.
This form is using........
Set rs = New ADODB.Recordset
    rs.Open "wol", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
3. Redisplay DataReport.. New entries not there.
*If i close whole program , and reopen,display Datareport, all ok.
-------------------------------------------------
DataReport Code....
on error goto Isopen
DataEnvironment1.Connection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=boss;Data Source=" & Trim(App.Path) & "\accesswol.MDB" & ";Persist Security Info=False"
Isopen: On error goto 0
DataReport2.Refresh
DataReport2.Show
==================
Refresh...Does not seem to work.!!! I only see original items.
Do i have to close the above connection and reopen??
==========================================================

Appreciate any advice, and code to fix , if possible

Regards  Turnerrob
0
Comment
Question by:turnerrob
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 52

Accepted Solution

by:
Ryan Chong earned 50 total points
ID: 6435207
Hi turnerrob,

Refresh your recordset ?:

If DataEnvironment1.myRs.state = 1 Then DataEnvironment1.myRs.Close

DataEnvironment1.myRs.Open mySQL

regards.
0
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6435439
Look at this:
http://support.microsoft.com/support/kb/articles/Q244/7/79.ASP

From the above link, you could try:

  Load DataEnvironment1
  With DataEnvironment1
    If .rsCommand1.State <> 0 Then .rsCommand1.Close
    .Command1 CDate(Text1.Text)
  End With
  DataReport1.Refresh
  If DataReport1.Visible = False Then DataReport1.Show

If you dont use parameters, just remove the parameter, in the Command Execute statement like,
    .Command1

Hope it helps.
0
 

Author Comment

by:turnerrob
ID: 6435820
Thanks for the help in pointing me in the right direction.


I ended up , i hope, effectively  doing the same thing , as your comment., see below.

Ie. Using Unload

I have tested it for about 10 minutes and it seems to be ok.

If you can see any flaws in using Unload, i would appreciate your comments
------------------------------


Private Sub Command8_Click()
    Unload DataEnvironment1
    DataEnvironment1.Connection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=boss;Data Source=" & Trim(App.Path) & "\accesswol.MDB" & ";Persist Security Info=False""
   
    DataReport2.Show
   
End Sub

Hope this is the end of my DataReport Questions, its taken me a while to come to grips with it!!!%$#

Regards   Turnerrob
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question