im at college doing this project using delphi for a server and coding and using html and databases to creating a system that you can input details to store and create appointments though i want it to show a message when a field is empty and i click submit button
because when i click it the message appears but the procedure carrys on and the field gets stored empty still after i click the message off
any help would be gratefully appreciated
i feel like its something so simple yet i cant figure it out
if this helps this is a part of my code to help you.
//***Fathers Application Form Submit***
Code:quFathersApplicationFormSubmit.Close; quFathersApplicationFormSubmit.Parameters.ParamByName('pmFForename').Value := slParamsList.Values['AFFForename']; if (slParamsList.Values['AFFForename'] = '') then ShowMessage ('Fathers forename has no value') and quFathersApplicationFormSubmit.Close; quFathersApplicationFormSubmit.Parameters.ParamByName('pmFSurname').Value := slParamsList.Values['AFFSurname']; if (slParamsList.Values['AFFSurname'] = '') then ShowMessage ('Fathers surname has no value'); quFathersApplicationFormSubmit.Parameters.ParamByName('pmFDoB').Value := slParamsList.Values['AFFDDOB'] + '/' + slParamsList.Values['AFFMDOB'] + '/' + slParamsList.Values['AFFYDOB']; quFathersApplicationFormSubmit.Parameters.ParamByName('pmFAddress').Value := slParamsList.Values['AFFAddress']; if (slParamsList.Values['AFFAddress'] = '') then ShowMessage ('Fathers Address has no value'); quFathersApplicationFormSubmit.Parameters.ParamByName('pmFPostcode').Value := slParamsList.Values['AFFPostcode']; if (slParamsList.Values['AFFPostcode'] = '') then ShowMessage ('Fathers Postcode has no value'); quFathersApplicationFormSubmit.Parameters.ParamByName('pmFStatus').Value := slParamsList.Values['AFFStatus']; if (slParamsList.Values['AFFStatus'] = '') then ShowMessage ('Fathers status has no value'); quFathersApplicationFormSubmit.Parameters.ParamByName('pmFJobTitle').Value := slParamsList.Values['AFFJob']; if (slParamsList.Values['AFFJob'] = '') then ShowMessage ('Fathers job has no value'); quFathersApplicationFormSubmit.Parameters.ParamByName('pmFWorkAddress').Value := slParamsList.Values['AFFWorkAddress']; if (slParamsList.Values['AFFWorkAddress'] = '') then ShowMessage ('Fathers job address has no value'); quFathersApplicationFormSubmit.execSql;
Last edited by WingedPanther; 04-02-2009 at 03:58 PM. Reason: add code tags (the # button)
I would do elseif to chain that, with the actual "good" logic in the else statement.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks