Editing Labels

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • panjap
    New Member
    • Jan 2007
    • 53

    Editing Labels

    HI, its me again this time a really short question
    how do you enable when making a order in the sub form called “all customer order details sub form” alter the error message when you put the same product in the same order.

    currently in the all customer order details sub form”, i am mot allowed to enter products in twice for one order which is great. however the error message is automatic, and i want to edit this.
    Have you got any tips, it will be much apreciated
    thank you
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Originally posted by panjap
    HI, its me again this time a really short question
    how do you enable when making a order in the sub form called “all customer order details sub form” alter the error message when you put the same product in the same order.

    currently in the all customer order details sub form”, i am mot allowed to enter products in twice for one order which is great. however the error message is automatic, and i want to edit this.
    Have you got any tips, it will be much apreciated
    thank you
    If I follow your logic correctly, you wish to replace the Standard Acces Error message with a custom one of you choice and not display the generic one from Access. To accomplish this, you must place code in the Form's Error() Event and place the proper value in the Response parameter.


    Code:
    Private Sub Form_Error(DataErr As Integer, Response As Integer)
        Const conDuplicateKey = 3022
        Dim strMsg As String
    
        If DataErr = conDuplicateKey Then
            Response = acDataErrContinue
            strMsg = "Each employee record must have a unique " _
                & "employee ID number. Please recheck your data."
            MsgBox strMsg
        End If
    End Sub

    Comment

    • panjap
      New Member
      • Jan 2007
      • 53

      #3
      Originally posted by ADezii
      If I follow your logic correctly, you wish to replace the Standard Acces Error message with a custom one of you choice and not display the generic one from Access. To accomplish this, you must place code in the Form's Error() Event and place the proper value in the Response parameter.


      Code:
      Private Sub Form_Error(DataErr As Integer, Response As Integer)
          Const conDuplicateKey = 3022
          Dim strMsg As String
      
          If DataErr = conDuplicateKey Then
              Response = acDataErrContinue
              strMsg = "Each employee record must have a unique " _
                  & "employee ID number. Please recheck your data."
              MsgBox strMsg
          End If
      End Sub
      thank you for your help, i sucessfully applied this.
      thank you so much, i was really struggling on this, much appreciated
      cheers

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by panjap
        thank you for your help, i sucessfully applied this.
        thank you so much, i was really struggling on this, much appreciated
        cheers
        No problemo.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32645

          #5
          I didn't know that ADezii - Nice one :)

          Comment

          Working...