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 |
#11
|
|||
|
|||
Macros, Error Messages, and Forms
Yes. The form has numerous command buttons (save record, close, delete record,
add record, open reports, and so forth) making it easy for the end user. Cheese_whiz wrote: I go to a second field enter data then try to save the record. HOW do you try to "save the record"? Command button? CW -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200703/1 |
#12
|
|||
|
|||
Macros, Error Messages, and Forms
As an addum, I just this moment finished updating to Office 2003. Now I don't
know what that will do me as I have never used Access 2003 before. New learning curve I guess. Cheese_whiz wrote: I go to a second field enter data then try to save the record. HOW do you try to "save the record"? Command button? CW -- Message posted via http://www.accessmonster.com |
#13
|
|||
|
|||
Macros, Error Messages, and Forms
Heh, I can't quite get you to say that you're actually clicking on a "save"
button when you get the two messages, but I'm going to assume so for this post. Assumming that's true, try adding this to your save button on_click event: If Me.Dirty Then If IsNull(Me.Hull_Number) Then MsgBox ("You must enter a 'Hull Number' to save an issue" & vbCrLf _ & "Enter a Hull Number or press 'ESC' to clear the issue form") Exit Sub End If Me.Dirty = False Else If MsgBox("No changes made!", vbOKOnly, "OGCIT") = vbOK Then Exit Sub End If End If That code goes at the top of the on_click event (above any other commands you have in the code for that event). You probably don't have any, as I think you said you were using a macro to save the record. If you use this, you won't be using that macro anymore (see above for how to add this to the on_click event of your save button). I've used the code I"ve posted in access 2003 so it should work. Make sure I've correctly identified your field name(Hull_Number?). Hope this helps CW "thebiggermac via AccessMonster.com" wrote: As an addum, I just this moment finished updating to Office 2003. Now I don't know what that will do me as I have never used Access 2003 before. New learning curve I guess. Cheese_whiz wrote: I go to a second field enter data then try to save the record. HOW do you try to "save the record"? Command button? CW -- Message posted via http://www.accessmonster.com |
#14
|
|||
|
|||
Macros, Error Messages, and Forms
You are correct I do click on a Save button to save the data. Sorry about
that. I will try this code you sent and see what happens. Please remember VB code and I generally do not get along very well (lack of knowlege on my part) which is why I like to use macros. They are much simplier for my simple mind to grasp. Cheese_whiz wrote: Heh, I can't quite get you to say that you're actually clicking on a "save" button when you get the two messages, but I'm going to assume so for this post. Assumming that's true, try adding this to your save button on_click event: If Me.Dirty Then If IsNull(Me.Hull_Number) Then MsgBox ("You must enter a 'Hull Number' to save an issue" & vbCrLf _ & "Enter a Hull Number or press 'ESC' to clear the issue form") Exit Sub End If Me.Dirty = False Else If MsgBox("No changes made!", vbOKOnly, "OGCIT") = vbOK Then Exit Sub End If End If That code goes at the top of the on_click event (above any other commands you have in the code for that event). You probably don't have any, as I think you said you were using a macro to save the record. If you use this, you won't be using that macro anymore (see above for how to add this to the on_click event of your save button). I've used the code I"ve posted in access 2003 so it should work. Make sure I've correctly identified your field name(Hull_Number?). Hope this helps CW As an addum, I just this moment finished updating to Office 2003. Now I don't know what that will do me as I have never used Access 2003 before. New [quoted text clipped - 5 lines] CW -- Message posted via http://www.accessmonster.com |
#15
|
|||
|
|||
Macros, Error Messages, and Forms
tbm,
No problem. For that to work, you'll need that code I gave you yesterday in the after_update event of FORM as well. As for vba code, it's well worth a little effort to learn. I'm far from an expert, but I can do most of the "small" things I need and there's quite a few resources out there with "big chuncks" when you need some functionality that's beyond your abilities. Macros are ok in some limited cases, but most of what I've read indicates that experienced developers largely scoff at them. I think there's some security issues among other things (and I also believe, appropriate to this situation, that macros are MUCH harder to troubleshoot than vba code). Anyway, just my two cents. I'm not the best helper around here, but I have dealt with the issue you have very recently so I know what I've tried to communicate to will work, provided the code makes it into your application properly and there's no hidden complications that I'm not aware of at this point. CW "thebiggermac via AccessMonster.com" wrote: You are correct I do click on a Save button to save the data. Sorry about that. I will try this code you sent and see what happens. Please remember VB code and I generally do not get along very well (lack of knowlege on my part) which is why I like to use macros. They are much simplier for my simple mind to grasp. Cheese_whiz wrote: Heh, I can't quite get you to say that you're actually clicking on a "save" button when you get the two messages, but I'm going to assume so for this post. Assumming that's true, try adding this to your save button on_click event: If Me.Dirty Then If IsNull(Me.Hull_Number) Then MsgBox ("You must enter a 'Hull Number' to save an issue" & vbCrLf _ & "Enter a Hull Number or press 'ESC' to clear the issue form") Exit Sub End If Me.Dirty = False Else If MsgBox("No changes made!", vbOKOnly, "OGCIT") = vbOK Then Exit Sub End If End If That code goes at the top of the on_click event (above any other commands you have in the code for that event). You probably don't have any, as I think you said you were using a macro to save the record. If you use this, you won't be using that macro anymore (see above for how to add this to the on_click event of your save button). I've used the code I"ve posted in access 2003 so it should work. Make sure I've correctly identified your field name(Hull_Number?). Hope this helps CW As an addum, I just this moment finished updating to Office 2003. Now I don't know what that will do me as I have never used Access 2003 before. New [quoted text clipped - 5 lines] CW -- Message posted via http://www.accessmonster.com |
#16
|
|||
|
|||
Macros, Error Messages, and Forms
Thanks CW, your code worked. Now all I have to do is tweak it for the project.
I have absolutely no clue how to do that yet, but I will figure it out. At least now I don't have that second error message box popping up. Again, thanks a lot. Cheese_whiz wrote: tbm, No problem. For that to work, you'll need that code I gave you yesterday in the after_update event of FORM as well. As for vba code, it's well worth a little effort to learn. I'm far from an expert, but I can do most of the "small" things I need and there's quite a few resources out there with "big chuncks" when you need some functionality that's beyond your abilities. Macros are ok in some limited cases, but most of what I've read indicates that experienced developers largely scoff at them. I think there's some security issues among other things (and I also believe, appropriate to this situation, that macros are MUCH harder to troubleshoot than vba code). Anyway, just my two cents. I'm not the best helper around here, but I have dealt with the issue you have very recently so I know what I've tried to communicate to will work, provided the code makes it into your application properly and there's no hidden complications that I'm not aware of at this point. CW You are correct I do click on a Save button to save the data. Sorry about that. I will try this code you sent and see what happens. Please remember VB [quoted text clipped - 43 lines] CW -- Message posted via http://www.accessmonster.com |
#17
|
|||
|
|||
Macros, Error Messages, and Forms
tbm,
Glad it worked. If you have something particular in mind in terms of "tweaks", I can try to help with those. Again, others are more competent than I am, so maybe a new thread when you run into a question/problem will elicit some less scatter-brained respondants. Good luck, CW "thebiggermac via AccessMonster.com" wrote: Thanks CW, your code worked. Now all I have to do is tweak it for the project. I have absolutely no clue how to do that yet, but I will figure it out. At least now I don't have that second error message box popping up. Again, thanks a lot. Cheese_whiz wrote: tbm, No problem. For that to work, you'll need that code I gave you yesterday in the after_update event of FORM as well. As for vba code, it's well worth a little effort to learn. I'm far from an expert, but I can do most of the "small" things I need and there's quite a few resources out there with "big chuncks" when you need some functionality that's beyond your abilities. Macros are ok in some limited cases, but most of what I've read indicates that experienced developers largely scoff at them. I think there's some security issues among other things (and I also believe, appropriate to this situation, that macros are MUCH harder to troubleshoot than vba code). Anyway, just my two cents. I'm not the best helper around here, but I have dealt with the issue you have very recently so I know what I've tried to communicate to will work, provided the code makes it into your application properly and there's no hidden complications that I'm not aware of at this point. CW You are correct I do click on a Save button to save the data. Sorry about that. I will try this code you sent and see what happens. Please remember VB [quoted text clipped - 43 lines] CW -- Message posted via http://www.accessmonster.com |
#18
|
|||
|
|||
Macros, Error Messages, and Forms
I'm going to post a new thread under general users 1 this time concerning the
tweaks I need as this one is getting fairly long. See you over there. Cheese_whiz wrote: tbm, Glad it worked. If you have something particular in mind in terms of "tweaks", I can try to help with those. Again, others are more competent than I am, so maybe a new thread when you run into a question/problem will elicit some less scatter-brained respondants. Good luck, CW Thanks CW, your code worked. Now all I have to do is tweak it for the project. I have absolutely no clue how to do that yet, but I will figure it out. At [quoted text clipped - 28 lines] CW -- Message posted via http://www.accessmonster.com |
#19
|
|||
|
|||
Macros, Error Messages, and Forms
On Thu, 01 Mar 2007 17:58:17 GMT, "thebiggermac via AccessMonster.com"
u31786@uwe wrote: Please remember VB code and I generally do not get along very well (lack of knowlege on my part) which is why I like to use macros. They are much simplier for my simple mind to grasp. Don't let VBA code buffalo you. It's very logical (mindlessly so, even a totally idiotic INTEL chip can figure it out bg) and systematic. In this case - VBA code has a huge advantage over macros. VBA code can trap errors and respond to them; Macros *cannot*. If you want error trapping, CheeseWhiz is perfectly correct - code is the way to go. John W. Vinson [MVP] |
|
Thread Tools | |
Display Modes | |
|
|