Re: Access Error Messages

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Okay, from the beginning.... I have a form that has a subform in it. In the
subform, there is a field that is used for a date. I have the short date
input mask - 99/99/00;0;_ in this field, however if the user accidentally
enters a letter instead of a number or enters 10/10/2005 accidently they get
the error - "The value you entered isn't appropriate for the input mask etc,
etc. -Error number 2279. So in the after update event of the date field I
have the code I mentioned earlier. I have put a break in, but the message
comes up without even triggering the break. If you want to recreate the
problem, create a date field with a short date input mask, but delete two of
the "year" zeros because my user doesn't like to enter the full year just the
two digits - and maybe this is what is causing my problem, I don't know. I
would just like to have better message that says something like "Please enter
the date as **/**/**." because the user seems to get this message frequently
and asked if it could be made more user friendly.

Thanks again for any help!


"RD" wrote:

> Ok ... I've read all the posts and replies. While I respect David very much, I
> think he's missing something here. For that matter, I think we may all be
> missing something here. A full explanation of what you're trying to do, your
> code, and exactly the error(s) you're getting will go a long way to figuring out
> what is going wrong and where it is doing so.
>
> I do have another function that returns other error messages but I've found that
> one rather useless and probably useless for what you're trying to acheive.
>
> So, to me, it looks like your structure looks ok. On error go to this place.
> If it doesn't go there, you must not be generating the error.
>
> The process *is* logical. All we have to do is walk through it. Sometimes
> forward is good ... sometimes backward is good. All depends on the logic.
>
> So, have you stepped through the code and watched each value and whatnot? I see
> the beginning and ending of your code but I suspect there may be more going on.
>
> Are you positive that this is the error that is generated *every time*? Maybe
> there is something else going on.
>
> I dunno ... just fishing. I get so bogged down in my own projects that it's
> sometimes a relief to work on soneone else's.
>
> I'll be here (at home) all day on Monday (working on a problem child app that I
> wish would go away). It's my day off but I'm working at least 8 hours. Helping
> you out would afford me a welcome distraction.
>
> Regards,
> RD
>
>
> On Sun, 9 Oct 2005 15:04:01 -0700, "AT" <AT@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >Both of you were very helpful, thank you. But I'm still having a problem.
> >
> >Here is the code I am using on my after update of the date field.
> >
> >Private Sub FEntryDate_AfterUpdate()
> >On Error GoTo Err_FEntryDate_AfterUpdate
> >
> >
> >Exit_FEntryDate_AfterUpdate:
> > Exit Sub
> >
> >Err_FEntryDate_AfterUpdate:
> >Select Case Err.Number
> > Case 2279
> > MsgBox "You must enter the date."
> > End Select
> >
> > Resume Exit_FEntryDate_AfterUpdate
> >
> >End Sub
> >
> >But it doesn't seem to trigger, I keep getting the standard Access error
> >message. Any ideas?
> >
> >Thanks!
> >
> >
> >"David C. Holley" wrote:
> >
> >> There's some code out there that will snoop around the error messages
> >> and create a table complete with error messages. It might even been in
> >> Access help. Its seems to be pretty popular so it should be that
> >> difficult to find. As to acutally doing vat you vant to do...
> >>
> >> Add
> >>
> >> On Error Goto mySub_Error
> >>
> >> at the start of where you want to trap the errors, typically at the
> >> start of the SUB or FUNCTION
> >>
> >> at the end add
> >>
> >> mySub_Exit: 'This and mySub_Error are called labels and used
> >> Exit Sub 'for program flow. Error handlers typically reside
> >> 'at the bottom of the SUB/FUNCTION. The _Exit label
> >> 'is here to explicity EXIT the SUB otherwise the
> >> 'Code would continue on down to the Error handler
> >> 'For a practical example, create a button on a form
> >> 'that opens another form and then look at the code
> >> 'FYI if you need to turn of the On Error statement
> >> 'use On Error GoTo 0
> >> 'that will cause the Access to follow the general
> >> 'error handling options set in OPTIONS
> >>
> >> mySub_Error:
> >> Select Case err.number
> >> Case [number here]
> >> [do something, typically and error msg]
> >> [and then RESUME to return to the next line of code or]
> >> [Exit sub]
> >> Case [number here]
> >> Case [number here]
> >> end Select
> >>
> >> AT wrote:
> >> > Does anyone know where to find a list of the error numbers that are assigned
> >> > to the Access error messages that pop up? For example, I want to change the
> >> > "The value you entered isn't appropriate for the input mask...." to a little
> >> > better description, but I don't know where to find the number of the error.
> >> >
> >> > Thanks!
> >> >
> >>
>
>
.



Relevant Pages

  • Re: copy files between drives from within access 2003
    ... I'm getting no error messages now. ... isn't working - just a case of adding a switch ot two for xcopy. ... Private Sub Command1_Click ... I havn't added the /d switch at the moment but added the /e switch (I ...
    (microsoft.public.access.modulesdaovba)
  • Re: Access Error Messages
    ... think he's missing something here. ... >Private Sub FEntryDate_AfterUpdate ... >But it doesn't seem to trigger, I keep getting the standard Access error ... >> There's some code out there that will snoop around the error messages ...
    (microsoft.public.access.modulesdaovba)
  • Re: How do I declare an Excel add-in in Access?
    ... I copied the Sub and tested it as it was given. ... get error messages as indicated in both instances. ... > ' Excel Library Directory. ... > Set objExcel = Nothing ...
    (microsoft.public.access.formscoding)
  • RE: Review values in subform before closing main form
    ... I'm still getting error messages. ... Office Access can't find the field 'PATIENT_NAME' referred to in your ... So it's Name of the main form, Name of the subform control, then the ... Private Sub Form_Unload ...
    (microsoft.public.access.formscoding)
  • User Controls and IIS 5.1
    ... My ASCX file looks like this: What my ASPX file looks like comes next, ... and one of all the error messages comes in the end. ... Public UserName as String ... public sub Submit ...
    (microsoft.public.dotnet.framework.aspnet.buildingcontrols)