![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Code Samples & Tips Share your recent discoveries and ideas with other users. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
As a reaction on some code I see. As in the help-example the goto can give unpredictable results. The code will be verry difficult to debug. Tip: don't use labels other then an errorlabel. Let the sub do just one single task, so you can call the entire sub in recursive.
example Sub btnDCRecSave_Click ' pre het keyfield is uniek ' post waardes worden weggescheven in de geheugentabel If KeyFieldUnique(date) = true Then RecordSave(...........) Else lvYesNo =Msgbox("date already exists. Delete existing record??")," ",cmsgboxYesNo,cMsgBoxQuestion) If lvYesNo =cYes Then smnuDCRecDelete_Click 'RecordDelete(aTable) <-- delete the record that has the same keyfield gv_tbl_mutaties = true gv_rec_Mutaties = false btnDCRecSave_Click 'recursieve call <--- checks again the keyfield if it is unique End If End If Last edited by paul j : 11-11-2007 at 01:03 PM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Avoid starting a program after a given time | Arrie | Questions & Help Needed | 2 | 05-31-2008 10:06 AM |
| Probleme bei device.exe wegen goto-Befehl | urgott | German Forum | 13 | 01-24-2008 10:01 AM |
| Goto problem | klaus | Questions & Help Needed | 2 | 11-15-2007 02:28 PM |
| Error when loading table how to avoid | tvrman | Questions & Help Needed | 2 | 08-04-2007 09:32 PM |
| Quick question to avoid going down a long dead end route | LineCutter | Questions & Help Needed | 2 | 05-22-2007 08:29 AM |