Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping Edit Windows in a Form

Status
Not open for further replies.

BillKilgore

Programmer
Mar 17, 2002
60
US
I’m pretty new Delphi though I’ve programmed in PL1 and Cobol through Pascal and C++. This is my first experience with GUI programming. I’ve gotten to the point where I can open a form, read data records into it, revise those records, and write the data out using streams. On my current form I want to enter personnel records . The data consists of building, department, last name, first name,…, pay grade. After I get the data into the edit windows, I want to write the tuple to a binary file then, when I press a ‘Save’ button, return only to the first name window, not the building window because the building and department codes remain the same for several employes. There are several buildings and several departments in those buildings. Thanks for sticking with me this far...

W. Kilgore
 
You can do these things
Set the forms active control
disable the edit controls that user should not change
set the onenter event for the edit controls that user should not change that causes form.activecontrol to be FirtNameEdit

Mick
 
Are you using separate "windows" or are you using edit boxes (TEdit or something similar) on a single window? If you're using edit boxes, all you have to do is:

Edit1.SetFocus;

(replace "Edit1" with the name of the edit box for the first name.)

-D
 
Thank you people for your timely responses. Delphi's a long way from Turbo Pascal 3.0 but I like it a lot more than MS's C++ stuff. Thanks again.

W Kilgore
 
Why don't use a "normal" desktop database to store the data. That is combining current technologies. I also did Turbo Pascal and creating my own data structures with File of Record but my advice is use paradox or access or dbase for that.
Delphi has the database desktop to manipulate paradox and db files.

Create your tables in paradox, and write an application in Delphi that uses the db components (ttable, dbedit, dbgrid) to populate the data.

Advantages:
You learn a lot more, you don't need to write your own seek method to find data, and you can concentrate on the visual disign of your application

Regards

Steven van Els
SAvanEls@cq-link.sr
 
Thank you Steven. I'm in pretty deep but I think you're probably right. I've got Access which I've used before so I could give that a try.

Bill Kilgore
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top