Link to home
Start Free TrialLog in
Avatar of bobby6055
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

 
Avatar of als315
als315
Flag of Russian Federation image

Check this sample
DB27038488.mdb
ASKER CERTIFIED SOLUTION
Avatar of Lambert Heenan
Lambert Heenan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bobby6055
bobby6055

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
Debug highlighted ..... Me. Requery

so I changed it to .,..... Me.Refresh
....and the error disappeared.
Sorry 'bout that. I often mix up refresh and requery. :-)