Solved

DataReport Refresh not Working

Posted on 2001-08-28
3
202 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
3 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now