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
|
|||
|
|||
save record button easier way?
Using Access 2003 Whats the easiest way to save a record after edit and
after insert behind a save commnad button. For example query1.posts ect ect. Below is what the command button generates but must be a cleaner way? Thaks for any help Private Sub Command59_Click() On Error GoTo Err_Command59_Click DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_Command59_Click: Exit Sub Err_Command59_Click: MsgBox Err.DESCRIPTION Resume Exit_Command59_Click End Sub |
#2
|
|||
|
|||
save record button easier way?
Well, that's only one line of code (not including the error handling) so
I'm not sure what you mean by a *cleaner* way. I suppose you could replace it with; Private Sub Command59_Click() On Error GoTo Err_Command59_Click DoCmd.RunCommand (acCmdSaveRecord) Exit_Command59_Click: Exit Sub Err_Command59_Click: MsgBox Err.DESCRIPTION Resume Exit_Command59_Click End Sub BTW - you may want to consider giving your controls more meaningful names. As time goes on and your db grows, having your code full of references like Command59 and Text23, etc. will make it difficult to know what's what. -- _________ Sean Bailey "Dean Hastas" wrote: Using Access 2003 Whats the easiest way to save a record after edit and after insert behind a save commnad button. For example query1.posts ect ect. Below is what the command button generates but must be a cleaner way? Thaks for any help Private Sub Command59_Click() On Error GoTo Err_Command59_Click DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_Command59_Click: Exit Sub Err_Command59_Click: MsgBox Err.DESCRIPTION Resume Exit_Command59_Click End Sub |
#3
|
|||
|
|||
save record button easier way?
If Me.Dirty Then Me.Dirty = False
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Dean Hastas" wrote in message news:xJ-dnSOijMd62orVnZ2dnUVZ_hqdnZ2d@dundkirkandfredoniat elephone... Using Access 2003 Whats the easiest way to save a record after edit and after insert behind a save commnad button. For example query1.posts ect ect. Below is what the command button generates but must be a cleaner way? Thaks for any help Private Sub Command59_Click() On Error GoTo Err_Command59_Click DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_Command59_Click: Exit Sub Err_Command59_Click: MsgBox Err.DESCRIPTION Resume Exit_Command59_Click End Sub |
#4
|
|||
|
|||
save record button easier way?
"Douglas J. Steele" wrote in message
... If Me.Dirty Then Me.Dirty = False Is that documented somewhere? It doesn't seem to be in the installed help files for Access 2003. -- Clif Still learning Access 2003 -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Dean Hastas" wrote in message news:xJ-dnSOijMd62orVnZ2dnUVZ_hqdnZ2d@dundkirkandfredoniat elephone... Using Access 2003 Whats the easiest way to save a record after edit and after insert behind a save commnad button. For example query1.posts ect ect. Below is what the command button generates but must be a cleaner way? Thaks for any help Private Sub Command59_Click() On Error GoTo Err_Command59_Click DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_Command59_Click: Exit Sub Err_Command59_Click: MsgBox Err.DESCRIPTION Resume Exit_Command59_Click End Sub |
#5
|
|||
|
|||
save record button easier way?
http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx
Unfortunately, while it points out that the Dirty property is updatable, it fails to mention that setting it to False saves the record. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Clif McIrvin" wrote in message ... "Douglas J. Steele" wrote in message ... If Me.Dirty Then Me.Dirty = False Is that documented somewhere? It doesn't seem to be in the installed help files for Access 2003. -- Clif Still learning Access 2003 -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Dean Hastas" wrote in message news:xJ-dnSOijMd62orVnZ2dnUVZ_hqdnZ2d@dundkirkandfredoniat elephone... Using Access 2003 Whats the easiest way to save a record after edit and after insert behind a save commnad button. For example query1.posts ect ect. Below is what the command button generates but must be a cleaner way? Thaks for any help Private Sub Command59_Click() On Error GoTo Err_Command59_Click DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_Command59_Click: Exit Sub Err_Command59_Click: MsgBox Err.DESCRIPTION Resume Exit_Command59_Click End Sub |
#6
|
|||
|
|||
save record button easier way?
"Douglas J. Steele" wrote in message
... http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx Unfortunately, while it points out that the Dirty property is updatable, it fails to mention that setting it to False saves the record. Thanks, Doug! A quick scan of that page looks just like my installed help file. That serves as a reminder to come back here and verify what the official documentation says, doesn't it? -- Clif Still learning Access 2003 |
Thread Tools | |
Display Modes | |
|
|