Solved

How to set current row before form opens

Posted on 1997-11-10
2
225 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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