Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DataReport Refresh not Working

Posted on 2001-08-28
3
Medium Priority
?
247 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 53

Accepted Solution

by:
Ryan Chong earned 150 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

Independent Software Vendors: 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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

618 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