Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to set current row before form opens

Posted on 1997-11-10
2
Medium Priority
?
229 Views
Last Modified: 2010-04-04
I want to set current row in query before form opens in dependence on given Id as following:
01  Query.Open;
02  while (not Query.EOF) and
03    (Id  Query.Fields [0].asInteger) do
04      Query.Next;
05  ShowModal;
and get error message bout access violation at address ...
When I remove lines 02-04 its ok but not exactly what i meant :)
Tell me please another way to set current row.
Thanx.
0
Comment
Question by:deng
2 Comments
 
LVL 3

Accepted Solution

by:
Pegasus100397 earned 300 total points
ID: 1349861
Deng,

If you have the ShowModal statement in a FormCreate event it can cause an access violation. Try this instead in the CALLING form:

Application.CreateForm(TFormName, FormName);
FormName.ShowModal;

The code will execute (when created) then return to the caller which will in turn do a ShowModal on the form.

Good luck with your project!
Pegasus
0
 

Author Comment

by:deng
ID: 1349862
thanx
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

876 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