Solved

Very Urgent!!!

Posted on 2000-05-02
8
174 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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 50 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

729 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