Kamis, 29 September 2011

[MS_AccessPros] error 13 type mismatch

 

Dear members,I am using Access 2003. I have a form with a combobox. When there is not a data I double click the combo to open a pop up form and put new records with it. I found this VB code at Allen Brown's web site and used it. It works but it gives ErrorNo:13..type mismatch. By the way it saves my data but it does not requery the combo box. I am not good with VB codes, how can I solve the problem? Thanks for your help in advance.

Private Sub Form_AfterUpdate()
On Error GoTo Err_Handler
'Purpose: Requery the combo that may have called this in its DblClick
Dim cbo As ComboBox
Dim iErrCount As Integer
Const strcCallingForm = "frm_Ýs_Kaydý"

If CurrentProject.AllForms(strcCallingForm).IsLoaded Then
Set cbo = Forms(strcCallingForm)!ÝsNo
cbo.Requery

End If

Exit_Handler:
Exit Sub

Err_Handler:
'Undo the combo if it has a partially entered value.
If (Err.Number = 2118) And (iErrCount < 3) And Not (cbo Is Nothing) Then
cbo.Undo
Resume
End If
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume Exit_Handler
End Sub

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar