bobby6055
asked on
Deleting current record
I have tried several onclick delete code. Now I want to try something new using some conditions as follows.
Perform delete action in the Edit or newRecord mode with the following defined conditions.
(a). If "IsNull or nothing" in text1(currentscreen), or text2(currentscreen) or text3(currentscreen),
then msgbox "Nothing to delete.
Else....
(b). If "Not Is Null" text1(currentscreen), or text2(currentscreen) or text3(currentscreen),
Then msgbox "Are you sure you want to delete the current record #111 (for example)
If User Response is "Yes" then perform the delete action for record id #111
If User Response is "No" then do not perform the delete action for record id #111
Perform delete action in the Edit or newRecord mode with the following defined conditions.
(a). If "IsNull or nothing" in text1(currentscreen), or text2(currentscreen) or text3(currentscreen),
then msgbox "Nothing to delete.
Else....
(b). If "Not Is Null" text1(currentscreen), or text2(currentscreen) or text3(currentscreen),
Then msgbox "Are you sure you want to delete the current record #111 (for example)
If User Response is "Yes" then perform the delete action for record id #111
If User Response is "No" then do not perform the delete action for record id #111
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
LambertHeenan:
I tried your suggestion from an Onclick command button. When I clicked the button to delete, I recieved
a Microsoft Visual Basic dialog box with a Run-Time error '3167': "Record Deleted"
How do I resolve the error?
Bobby
I tried your suggestion from an Onclick command button. When I clicked the button to delete, I recieved
a Microsoft Visual Basic dialog box with a Run-Time error '3167': "Record Deleted"
How do I resolve the error?
Bobby
ASKER
Debug highlighted ..... Me. Requery
so I changed it to .,..... Me.Refresh
....and the error disappeared.
so I changed it to .,..... Me.Refresh
....and the error disappeared.
Sorry 'bout that. I often mix up refresh and requery. :-)
DB27038488.mdb