A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

IsNot Dirty



 
 
Thread Tools Display Modes
  #1  
Old June 7th, 2004, 03:36 PM
Kenny G
external usenet poster
 
Posts: n/a
Default IsNot Dirty

Hello,

Below is the current code I use for a DB I am building. The only problem I have is that if the user doesn't put anything in the form the standard message "The command or action "Save Record" isn't available now. In the case for the Undo control the same message comes up but with an Undo message. I need to place some code here that doesn't seem to cryptic to the user. Where, how and why would I place the code in my current code?

Many thanks.

Kenny G

Private Sub cmdsaverecordDataEntryCompleteTheRecord_Click()
On Error GoTo Err_cmdsaverecordDataEntryCompleteTheRecord_Click

Dim intanswer As Integer

intanswer = MsgBox("Do You Want To Complete Another Record?", vbYesNo)

Select Case intanswer
Case vbYes
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToControl "MRN"
Case vbNo
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToControl "cmdReturnToMainMenu"
End Select

Exit_cmdsaverecordDataEntryCompleteTheRecord:
Exit Sub

Err_cmdsaverecordDataEntryCompleteTheRecord_Click:
MsgBox Err.Description
Resume Exit_cmdsaverecordDataEntryCompleteTheRecord

End Sub

  #2  
Old June 7th, 2004, 03:47 PM
Van T. Dinh
external usenet poster
 
Posts: n/a
Default IsNot Dirty

Private Sub cmdsaverecordDataEntryCompleteTheRecord_Click()

Dim intanswer As Integer

On Error GoTo Err_cmdsaverecordDataEntryCompleteTheRecord_Click

If Me.Dirty = False Then
MsgBox "Nothing to save ..."
' Whatever you want to do in this case
Else
' Your current code here
....
End If
....

Another method is to disable the CommandButton on NewRec and only enable it
when the Form is dirtied.

--
HTH
Van T. Dinh
MVP (Access)


"Kenny G" wrote in message
...
Hello,

Below is the current code I use for a DB I am building. The only problem

I have is that if the user doesn't put anything in the form the standard
message "The command or action "Save Record" isn't available now. In the
case for the Undo control the same message comes up but with an Undo
message. I need to place some code here that doesn't seem to cryptic to the
user. Where, how and why would I place the code in my current code?

Many thanks.

Kenny G

Private Sub cmdsaverecordDataEntryCompleteTheRecord_Click()
On Error GoTo Err_cmdsaverecordDataEntryCompleteTheRecord_Click

Dim intanswer As Integer

intanswer = MsgBox("Do You Want To Complete Another Record?", vbYesNo)

Select Case intanswer
Case vbYes
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,

acMenuVer70
DoCmd.GoToControl "MRN"
Case vbNo
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,

acMenuVer70
DoCmd.GoToControl "cmdReturnToMainMenu"
End Select

Exit_cmdsaverecordDataEntryCompleteTheRecord:
Exit Sub

Err_cmdsaverecordDataEntryCompleteTheRecord_Click:
MsgBox Err.Description
Resume Exit_cmdsaverecordDataEntryCompleteTheRecord

End Sub



  #3  
Old June 7th, 2004, 04:11 PM
Kenny G
external usenet poster
 
Posts: n/a
Default IsNot Dirty

Van,

Many thanks, the more I learn the more I realize I don't know.

Kenny G
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.