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
|
|||
|
|||
What's wrong with this Sub?
Private Sub btnCommentSubmit_Click()
On Error GoTo Err_btnCommentSubmit_Click Me.CommentDate = Now DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_btnCommentSubmit_Click: Exit Sub Err_btnCommentSubmit_Click: MsgBox Err.Description Resume Exit_btnCommentSubmit_Click End Sub I get "The DoMenuItem Action was Canceled" Error ?? Thank you! |
#2
|
|||
|
|||
What's wrong with this Sub?
Try a different method of saving the record, by setting the dirty property to
false: Private Sub btnCommentSubmit_Click() On Error GoTo Err_btnCommentSubmit_Click Me.CommentDate = Now Me.Dirty = False Exit_btnCommentSubmit_Click: Exit Sub Err_btnCommentSubmit_Click: MsgBox Err.Description Resume Exit_btnCommentSubmit_Click End Sub Tom Wickerath Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.html __________________________________________ "justme" wrote: Private Sub btnCommentSubmit_Click() On Error GoTo Err_btnCommentSubmit_Click Me.CommentDate = Now DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Exit_btnCommentSubmit_Click: Exit Sub Err_btnCommentSubmit_Click: MsgBox Err.Description Resume Exit_btnCommentSubmit_Click End Sub I get "The DoMenuItem Action was Canceled" Error ?? Thank you! |
#3
|
|||
|
|||
What's wrong with this Sub?
Hi Thanks for answering! I replaced my sub, opened my form, entered a comment in the comment text box, and hit the submit button. The date went into the CommentDate field ok. but then the form doesn't close. I'm getting "The setting you entered isn't valid for this property" error What can I do? Thanks! |
#4
|
|||
|
|||
What's wrong with this Sub?
Can we assume that the CommentDate field is a Date/Time datatype? If not, it
needs to be, since you are setting the field = Now. Tom Wickerath Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.html __________________________________________ "justme" wrote: Hi Thanks for answering! I replaced my sub, opened my form, entered a comment in the comment text box, and hit the submit button. The date went into the CommentDate field ok. but then the form doesn't close. I'm getting "The setting you entered isn't valid for this property" error What can I do? Thanks! |
#5
|
|||
|
|||
What's wrong with this Sub?
Yes, the field type is a date/time General Date (Date and time) already. When
I click submit, the date goes in the box and the error message comes up. I click OK to the message, and then have to cancel out of my form. but when I go into my table, the comment and date are there just fine. It Is there anything else it could be? |
#6
|
|||
|
|||
What's wrong with this Sub?
Sorry to hear that you are still having problems with this. Right now, I'm
not able to provide much help. I've been without power at my home since early Friday morning last week. I live in the Seattle area; you may have heard on the news about severe windstorm damage in the Pacific Northwest. I had come into the office on Saturday evening, to get out of the cold and cook some dinner in the microwave, which is when I attempted to answer your question the first time. You can go ahead and send me a zipped copy of your database, and I will take a look at it when I get power back. My e-mail address is shown on the bottom of the contributor's page indicated in my sig. line below. (I'm replying to this message from my office, where we do have power, but I really cannot spend normal work hours helping on a newsgroup issue). Tom Wickerath Microsoft Access MVP http://www.access.qbuilt.com/html/ex...tributors.html http://www.access.qbuilt.com/html/search.html __________________________________________ "justme" wrote: Yes, the field type is a date/time General Date (Date and time) already. When I click submit, the date goes in the box and the error message comes up. I click OK to the message, and then have to cancel out of my form. but when I go into my table, the comment and date are there just fine. It Is there anything else it could be? |
Thread Tools | |
Display Modes | |
|
|