Kamis, 29 September 2011

RE: [MS_AccessPros] error 13 type mismatch

 

Try commenting out the error trap code (On Error) by placing a single quote at
the beginning of the line, then run your code. That should cause it to halt on
the statement that is failing. Click the Debug button in the error dialog to
see the code.

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 5:48 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] error 13 type mismatch

John, Thanks for quick reply.I didn't mentioned some details and some control
names doesn't fitting English. So I am writing the code with some change.There
are 3 controls on the form which depends a table with 3 fields. By the way I
tried the way you have suggested but it gave an error message:error 424:object
required. The code is like:

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_CaseRecord"

If CurrentProject.AllForms(strcCallingForm).IsLoaded Then
Set cbo = Forms(strcCallingForm)!CaseRecord_ID
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