Solved

DataReport Refresh not Working

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending a email via excel using vba 6 97
Adding to a VBA? 6 78
Added a column screws up code 5 63
Fastest way to find and count same items VB6 16 26
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

827 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