?
Solved

Forms and Classes

Posted on 2000-02-02
5
Medium Priority
?
167 Views
Last Modified: 2010-05-02
I have created a Master Detail form which uses a class module to add, edit ect.

I need to do some processing using sql on pressing the Update Button.

The sql does the processing ok, which effects my class (e.g. subsumes the detail lines from 4 lines to 1 line).

The problem I have got is that unless I drop the class and create a new one then the changes do not become evident on the screen.

Is there a way to refresh the class without having to close the class and recreate it.

I have tried:
 Primarycls.requery  
 form.refresh
 

Thanks For Your Help,  
0
Comment
Question by:kenmck
  • 2
  • 2
5 Comments
 

Expert Comment

by:BennyBunny
ID: 2481540
does your class have a requery method
where is the data visualized
which part of the form / class writes the data ..?
0
 
LVL 12

Expert Comment

by:roverm
ID: 2481587
Write a sub in your class to re-initialize all lines and call that sub (ok, method) after your sql statement.
0
 

Author Comment

by:kenmck
ID: 2481591
The class is the default class created by forms design wizard.

Id does have a requery method as below:

Public Sub Requery()
  DoingRequery = True
  DataMemberChanged "Primary"
  DataMemberChanged "Secondary"

  adoPrimaryRS.Requery

  DoingRequery = False
  DataMemberChanged "Primary"
  DataMemberChanged "Secondary"
End Sub

The data is displayed on screen and on pressing the update button the processing takes place subsuming 4 lines into 1, which it does in the Access database.

The problem is the form still displays the 4 lines, even though 3 of them do not exist. If I close the class and recreate it will then show the changes, but this does not seam to be very efficient.

I hope this helps.

Thanks,
0
 
LVL 12

Expert Comment

by:roverm
ID: 2481610
You can also try to close the connection and re-open it before your adoPrimaryRS.Requery line.
0
 

Accepted Solution

by:
BennyBunny earned 200 total points
ID: 2481709
maybe you have do rewrite the textcontrols(or in whatever style u display the data) with the data from the recordset to refill after updating the recordset.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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 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…
Suggested Courses

601 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