Undo is'nt available right now

Dais

New member
Local time
Tomorrow, 04:49
Joined
Jun 21, 2008
Messages
9
Hi all

Fairly new girlie here trying here trying my hardest but sometimes I become confused with all this stuff....lol. And yes, I always have a real good look for an answer first before posting.

I have a really simple form which is used to ADD records only. It has 4 fields only.

The first, 'Account Number' field is a required field. This is also the field the cursor is set to focus on upon opening the form.
The second is purely a text box where user enters his own information.
The third and fourth are combo boxes with data chosen from the drop boxes only. Eventually all fields will be required fields.

I have a button which says, "Durrrrrr......get me aoutta here...I am in the wrong place". When that button is clicked I want the user taken from that form to my home page, WITHOUT saving anything at all. It works fine so long as the user has entered 'something of a number' in the first box, but because they enter that form and THEN realize they are in the wrong place no data is entered. If there is 'nothing' entered there is the following message.

The command or action 'undo' isn't available right now etc etc etc. he same error applies to 'delete' or 'clear all'.

Now I know for sure that it is related to the fact that there is zero info entered on the form.

Can someone please tell me:
a) Where to start looking to remedy the problem
b) Help me out with some code or something to fix it
or c) Tell me I am doing so well and just keep trying!!!!!!:( ( Nah, don't tell me that please)
Thanks all and cheer up.!!!!
Dais
 
In the code use:
Code:
If Me.Dirty Then
  Me.Undo
End If
 
Thanks Bob

Thanks for the help Bob
Call me silly or dumb but I still cannot get it to work.

I called it a button at first but it's actually a label with some text. Does that make a difference....lol

Can you please tell me exactly where that code goes?
Like 'inside' this Label box code somewhere-

Private Sub Home()
On Error GoTo Err_Home


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Home:
Exit Sub

Err_Home:
MsgBox Err.Description
Resume Exit_Home_from_Add_Form_Click

End Sub

or in some form code somewhere?
or somewhere else completely?

I have tried putting it everywhere but I still get the same message. Well not undo exactly right now, it is 'The command or action DeleteRecord' etc etc

Sorry to be a pain but if I get to understand this correctly now I can use that for many other things I had planned for my project.

Thanks again
Cheers
Daisy
 
Thanks everyone. I seemed to have fixed it by adding to my macro.
And sorry but I don't know how to marked this thread as 'resolved'
Cheers all
Dais
 

Users who are viewing this thread

Back
Top Bottom