|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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! |
|
#2
|
||||
|
||||
|
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. |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > General - Question - Access Violation Error checking for null fields |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|