Solved

How to set current row before form opens

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

831 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