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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
IsNot Dirty
Van,
Many thanks, the more I learn the more I realize I don't know. Kenny G |
Thread Tools | |
Display Modes | |
|
|