Solved

How to set current row before form opens

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Correct Component for Shopping Cart. 2 96
QRReport  TQrmemo vertical stretching 1 42
Magic Software info 18 125
I want to use librsync in my Delphi backup application. 3 27
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now