Results 1 to 3 of 3

Thread: Mismatch error ...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    287

    Mismatch error ...

    Hi,

    I am getting type mismatch error. The txtDONO (Delivery Number) property set to text. Using MS Access database and the following is the code:

    VB Code:
    1. Private Sub txtDONO_Lostfocus()
    2. If txtDONO <> 0 Then
    3. txtSNO.SetFocus
    4.  
    5. Else
    6.  
    7. Dim MB As String
    8. MB = MsgBox("First enter the Delvery Number", vbYes, "Enter D.O. Number")
    9.  
    10. If MB = vbYes Then
    11. txtDONO.SetFocus
    12. End If
    13. End If
    14. End Sub

    Margaret

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Mismatch error ...

    VB Code:
    1. 'Use
    2. Dim MB As VbMsgBoxResult
    3. 'Instead of
    4. Dim MB As String
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Mismatch error ...

    There is no need for declaration you can directly write as:
    VB Code:
    1. if MsgBox("First enter the Delvery Number", vbYes, "Enter D.O. Number") = vbYes Then
    2.     txtDONO.SetFocus
    3. End If
    CS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width