Kamis, 29 September 2011

RE: [MS_AccessPros] error 13 type mismatch

 

rkulez-

Which statement is getting the error? Why not simply use:

Forms(strcCallingForm)!ÝsNo.Requery

.. but I'm not sure that VBA (that doesn't support Unicode) will handle that
ÝsNo control name.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of rkulez
Sent: Thursday, September 29, 2011 1:35 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [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

------------------------------------

Yahoo! Groups Links

__._,_.___
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