MackMan
Registered User.
- Local time
- Today, 17:28
- Joined
- Nov 25, 2014
- Messages
- 174
In the BeforeUpdate event of a form field, I'm holding open a messagebox (my own design) with DoEvents as I can't allow it to open in dialog mode.
The only thing with DoEvents is that's it eating processor usage as it's constantly looping until the form being held open has a user response.
Other than DoEvents is there an alternative where I can stop the code running still, yet save the processor useage? As I said I can't allow the form to open in dialog mode (as it doesn't retain it's formsize/border properties etc).
Code:
If Len(Me.ReminderTitle & vbNullString) > 0 Then
strLinkCriteria = "[ReminderTitle] = " & "'" & Remtitl & "'"
[COLOR="YellowGreen"]'checks reminders table for duplicate entries
[/COLOR] If DCount("ReminderTitle", "tblReminders", strLinkCriteria & " AND USERID = " & TempVars!TempLoginID & " AND reminderID <> " & Me.ReminderID) > 0 Then [COLOR="yellowgreen"]'undoes the duplicate entry and shows message box
[/COLOR] DoCmd.OpenForm "_frmMessagebox", , , , , , ErrCode & "|" & Remtitl
[B][I]Do While (SysCmd(acSysCmdGetObjectState, acForm, "_frmMessageBox") <> 0)
DoEvents
Loop
[/I][/B]
Me.ReminderTitle.Undo
Cancel = True
End If
End If
The only thing with DoEvents is that's it eating processor usage as it's constantly looping until the form being held open has a user response.
Other than DoEvents is there an alternative where I can stop the code running still, yet save the processor useage? As I said I can't allow the form to open in dialog mode (as it doesn't retain it's formsize/border properties etc).