Solved

DataReport Refresh not Working

Posted on 2001-08-28
3
222 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 51

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

756 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