Hi everyone.
I have posted this question a couple of times, and many of you gave me some helpful info, but I am still getting the error "previous operation cancelled" after my customized message box (I don't want the oper. cancelled msgbox to appear). This is what I have so far.
On before update of the form itself
Dim ctl as control
for each ctl in controls
if ctl.tag = "Required" then
if IsNull(ctl.value) then
msgBox ctl.name & " is required"
DoCmd.SetWarnings False
DoCmd.CancelEvent
DoCmd.SetWarnings True
exit for
end if
end if
next
end sub
I am now starting to wonder if I should be going to all of the required fields on the form itself and individually put in my msgBox code in the before update section of each textbox. Someone told me that the above route was the best way to go.
This is really embarassing because I have done research over the internet, helpfiles, bulletin boards and books, and can't see what I am doing wrong. I feel as though I have lost my mind!!
As always, any suggestions would be much appreciated
I have posted this question a couple of times, and many of you gave me some helpful info, but I am still getting the error "previous operation cancelled" after my customized message box (I don't want the oper. cancelled msgbox to appear). This is what I have so far.
On before update of the form itself
Dim ctl as control
for each ctl in controls
if ctl.tag = "Required" then
if IsNull(ctl.value) then
msgBox ctl.name & " is required"
DoCmd.SetWarnings False
DoCmd.CancelEvent
DoCmd.SetWarnings True
exit for
end if
end if
next
end sub
I am now starting to wonder if I should be going to all of the required fields on the form itself and individually put in my msgBox code in the before update section of each textbox. Someone told me that the above route was the best way to go.
This is really embarassing because I have done research over the internet, helpfiles, bulletin boards and books, and can't see what I am doing wrong. I feel as though I have lost my mind!!
As always, any suggestions would be much appreciated