Any hints/sugguestions

T

tracktraining

Hi All,

Any hint(s) on how to write “if DELETE FIELDS is clicked (Unfiltered), then
exit all subs and unfilter (if filter is on)â€.

Reasons:
Unfiltered works if just searching.

Unfiltered doesn’t work if in the middle of adding a record. So I want to
write something like “If Delete Fields is clicked, then a message box appears
‘The record you just entered has not been updated yet. Do you want to exit
the task? Yes / No (buttons). If yes, then exit sub, unfiltered the form, and
no record gets updated to the table. If no, then allow user to enter data as
is.


Any hints/suggestions are most appreciated.

THANKS,
Tracktraining
 
S

strive4peace

once you check your condition, maybe something like this:

'~~~~~~~~~~~~~~~~~

if MsgBox("The record you just entered has not been updated yet." _
& " Do you want to exit the task? " _
,vbYesNo, "Undo record and exit task?") = vbNo then

exit sub
end if

if me.dirty then me.undo
me.FilterOn = false

'~~~~~~~~~~~~~~~~~

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
T

tracktraining

Thank you.
--
Learning


strive4peace said:
once you check your condition, maybe something like this:

'~~~~~~~~~~~~~~~~~

if MsgBox("The record you just entered has not been updated yet." _
& " Do you want to exit the task? " _
,vbYesNo, "Undo record and exit task?") = vbNo then

exit sub
end if

if me.dirty then me.undo
me.FilterOn = false

'~~~~~~~~~~~~~~~~~

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top