Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 7th, 2008, 11:11 AM
marge marge is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Posts: 1 marge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 8 sec
Reputation Power: 0
Cool General - Question - Access Violation Error checking for null fields

Hello, I am new with this forum so I hope I'm doing this right.

Anyway, I am using Delphi 2006(a newbie with this also). I have a screen with 5 tabs. I only want to check for null Tedit and Tcombobox fields on tabscreen2. When i click on the update button and if there is a null field, I display an error message for the user to fill the required field in and all is well.
However, if there are no null fields, I get an access violation error when I click the update button. This is my code:

for FldCnt:= 0 to ComponentCount - 1 do
begin
if (Components[FldCnt] is TControl) then
if ((Components[FldCnt] as TControl).Parent.Name = 'TabSheet2') then
if ((Components [FldCnt] is TEdit) OR (Components [FldCnt] is TComboBox)) then
if ((TEdit(Components[FldCnt]).Text = '') OR (Tcombobox(Components[FldCnt]).Text = '')) then
begin
MessageDlg( 'Please enter a value for the required field.', mtInformation, [mbOK], 0 );
exit;
end;
end;

Any help would be greatly appreciated. Thanks!

Reply With Quote
  #2  
Old January 10th, 2008, 08:37 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,969 Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1Folding Points: 342040 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 5 Days 15 h 9 m 16 sec
Reputation Power: 1556
I assume you expect us to guess the code you have when pressing the button?
sorry, but we can't read minds.. yet.
if you want help you'll have to post relevant code.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > General - Question - Access Violation Error checking for null fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway