Looking for a workaround here. One that preferably doesn't involve making a bunch of user forms.
Background: I've got an Access DB used for scanning items in and out of the office. After each item is scanned, it verifies that the item is okay to leave the office. If it is not, a msgbox is called and says "This item is out of calibration, are you sure you want to take it?" (vbyesno)
Issue: When an item is scanned, the system sees the numbers from the bar code and a carriage return. This works great with the scanning form. However, if the user isn't paying attention when a msgbox appears and scans the next item, the carriage return will click the default value from the msgbox, close it and the user is none the wiser.
My temp solution: I added a third button (cancel) after the yes/no that becomes the new default value. Scanning a new item will click that and it just reopens the msgbox. Therefore the user should eventually notice. It's not really a good solution though.
Dim ans As Integer
'2 is vbCancel
ans = 2
Do While ans = 2
ans = MsgBox("Test", vbYesNoCancel + vbDefaultButton3 + vbSystemModal + vbExclamation)
if ans = 2 then
'Restart Loop
elseif ans = vbYes
'Do something
elseif ans = vbNo
'Do something else
end if
Loop
There are many different cases in which a msgbox can appear, so making an individual user form each one is something I'd hope to avoid.
Thanks,
Brock