?
Solved

Very Urgent!!!

Posted on 2000-05-02
8
Medium Priority
?
175 Views
Last Modified: 2010-05-02
Hi All,
I have a VB program with 2 forms, 1 is data entry(add,update,delete) and the other is a form with 10 option buttons for different reports, and a 'show report' button that does a print preview (report.show). The problem Im having is that if I go into form 1 and change some data on a record, it doesn't show up on the report unless I exit the program and re-enter. Any light you could shed on this would be greatly appreciated. (Using DAO)

Thanks in advance,
0
Comment
Question by:shyma
[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
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2769094
You need to refresh your recordset.

Show us some code of what you are doing!
0
 
LVL 15

Expert Comment

by:ameba
ID: 2769105
Maybe your report form does not unload, or it unloads, but is not set to nothing, so some form variables retain their values. Use this code:

Private Sub cmdReport_Click()
' show frmReport form
    Dim test As New frmReport
    test.Show vbModal
    Set test = Nothing
End Sub
0
 

Author Comment

by:shyma
ID: 2769307
I have got a master form conatins Header and details records. When I navigate through master records I can see the corresponding detail records also. In the same form I have put one Command Button to Print the current displayed information. (let us assume like an Ivoice - carries Header and Detail information.)  When I click the command button it is calling a datareport (datareport.show). It will not show the current one. Once I close and reopen the form then only it show the one we pressed. An Urgent reply is highly appreciated.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2769350
0
 
LVL 15

Expert Comment

by:ameba
ID: 2769701
If I understand your reply
>When I click the command button it is calling a datareport (datareport.show).

your code looks like this:
Private Sub cmdReport_Click()
' show frmReport form
    frmReport.Show
End Sub

Can you, please, reply to my suggestion, it was to use code like this:

Private Sub cmdReport_Click()
' show frmReport form
    Dim test As New frmReport
    test.Show vbModal
    Set test = Nothing
End Sub
0
 

Author Comment

by:shyma
ID: 2769939
I tried both solutions. But unfortunately it doesnot help me. Eagerly waiting for another suggestions.

Thanks a lot for your suggestions.
0
 
LVL 1

Accepted Solution

by:
pauljk earned 200 total points
ID: 2770000
You need to ensure that your data edit form is saving the information to the recordset.  You can force this with a button or you can use some kind of event like lost focus.  

The second form needs to have a refreshed recordset, especially if it is a disconnected recordset.  You can also re-run the report diplay code in your form by placing it in the On_Activate event of your Report form.  Here you can force your form to get new data.
0
 
LVL 1

Expert Comment

by:yfang
ID: 2771009
Here is a solution:

Add the following code before you show your report:

If DataEnvironment1.Connection1.State=1 then
DataEnvironment1.Connection1.Close
end if
DataEnvironment1.Connection1.Open
DataEnvironment1.Command1

Here DataEnvironment1, Connection1, and Command1 are the default names, which yo may need to replace with the ones you used in your project.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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 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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 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