Solved

How to set current row before form opens

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

17 Experts available now in Live!

Get 1:1 Help Now