DoMenuItem Enquires

  • Thread starter edisonl via AccessMonster.com
  • Start date
E

edisonl via AccessMonster.com

First tried: Delete with command below:
(Objectives: What I wana achieve is when checkbox is checked Aka ='True',
Particular recordset will be cut and paste into another table)

strsql = "INSERT INTO MyTable VALUES ('" &TextBox1 & "'"
CurrentDb.Execute strsql ' >>>
SQL Statement for inserting is fine
MySubform.SetFocus ' >>>
Can't Delete after successful insert
DoCmd.DoMenuItem acFormBar, acEditMenu, acDelete, , acMenuVer70

Second tried: Undo with command below:
(Objectives: Just a simple SelectAll & cancel to UnSelect All function in
checkbox thats all)

DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

ERROR MSG >> The command or action 'undo' isn't available now

Edison
 
B

Brian

Try this instead: DoCmd.RunCommand acCmdDeleteRecord

This assumes you want to delete the current record in a bound form's record
source.

The undo will not undo a select - only a change to the value. Not sure what
your SelectAll function includes.
 
E

edisonl via AccessMonster.com

hi Brian,

thanks for replying, duh ;)

erm.. my select all includes all checkbox.
1 of the field in each recordset.

Eg: Analogy would be a select all function in Email pehaps.. ?
Try this instead: DoCmd.RunCommand acCmdDeleteRecord

This assumes you want to delete the current record in a bound form's record
source.

The undo will not undo a select - only a change to the value. Not sure what
your SelectAll function includes.
First tried: Delete with command below:
(Objectives: What I wana achieve is when checkbox is checked Aka ='True',
[quoted text clipped - 16 lines]
 
B

Brian

Still reading between the lines a little, I am inferring that you may want to
undo the updates accomplished by an update query. Undo will not Undo a SQL
action, only the contents of controls on a form before they are udpated in
the underlying tables.

The Delete-related code you tried, and my post, both delete the current
record, not a set of records.

For either the Undo or Delete, you will need to use a query to do any type
of mass undo or update. However, there is a way to use transactions in Access
so you can roll back an entire query. See Allen Browne's example at
http://www.allenbrowne.com/ser-37.html.

edisonl via AccessMonster.com said:
hi Brian,

thanks for replying, duh ;)

erm.. my select all includes all checkbox.
1 of the field in each recordset.

Eg: Analogy would be a select all function in Email pehaps.. ?
Try this instead: DoCmd.RunCommand acCmdDeleteRecord

This assumes you want to delete the current record in a bound form's record
source.

The undo will not undo a select - only a change to the value. Not sure what
your SelectAll function includes.
First tried: Delete with command below:
(Objectives: What I wana achieve is when checkbox is checked Aka ='True',
[quoted text clipped - 16 lines]
 

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