本文介绍了A97错误#2109?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道为什么我在下面的

程序中可能会收到错误#2109?它不会出现在2个台式机上,但在笔记本电脑上确实是
。错误说:


"以下意外错误发生在Sub OwnerZip_AfterUpdate,

frmOwnerEntryFrm上的CBF。 2109:

当前记录中没有名为''OwnerCity''的字段。


Private Sub OwnerZip_AfterUpdate()

On Error GoTo OwnerZip_AfterUpdateErr

Dim ThisForm As String

ThisForm = Me.Name


If IsNull(DLookup( " [City]"" tblZipCodes",

" Zip = Forms!frmOwnerEntryFrm!OwnerZip"))GoTo NotFound

Forms!frmOwnerEntryFrm!OwnerCity = DLookup(" City"," tblZipCodes",

" Zip = Forms!frmOwnerEntryFrm!OwnerZip")

Forms!frmOwnerEntryFrm!OwnerState = DLookup(" State" ;," tblZipCodes",

" Zip = Forms!frmOwnerEntryFrm!OwnerZip")

ExitOwnerZip_AfterUpdate:

退出子


NotFound:

ZipNotFoundFlag = True''(此表单模块的全局)Zip

输入的代码未在表

''你可能希望我ncorporate你在Credi-Clean的
cust-entry表单上使用的AddZipBtn

MsgBox"找不到ZipCode - 手动输入城市和州。,48,

"不在邮政编码列表中 - " &安培; MyApp $& ",rev。 " &安培; MY_VERSION $

Dim MyControl As Control

设置MyControl = Forms!frmOwnerEntryFrm!OwnerCity

DoCmd.GoToControl MyControl.Name

退出Sub


OwnerZip_AfterUpdateErr:

如果Err = 2448那么GoTo NotFound''2448 =不能设置值错误

Dim r As String,k As String,Message3 As String

r ="以下意外错误发生在Sub

OwnerZip_AfterUpdate,CBF on" &安培; ThisForm& "。"

k = CRLF& CRLF& str $(Err)& : &安培;引用&错误$&引用

Message3 = r& k

MsgBox Message3,48,意外错误 - &安培; MyApp $& ",rev。 " &

MY_VERSION $

简历ExitOwnerZip_AfterUpdate


结束子


我不喜欢我认为我在程序中引用任何表格字段为

''OwnerCity''

解决方案




Anybody know why I might be getting error #2109 during the
procedure below? It does not occur on 2 desktops, but did
on a laptop. The error said:

"The following unexpected error occurred in Sub OwnerZip_AfterUpdate,
CBF on frmOwnerEntryFrm. 2109: "There is no field named ''OwnerCity'' in
the current record."

Private Sub OwnerZip_AfterUpdate()
On Error GoTo OwnerZip_AfterUpdateErr
Dim ThisForm As String
ThisForm = Me.Name

If IsNull(DLookup("[City]", "tblZipCodes",
"Zip=Forms!frmOwnerEntryFrm!OwnerZip")) Then GoTo NotFound
Forms!frmOwnerEntryFrm!OwnerCity = DLookup("City", "tblZipCodes",
"Zip=Forms!frmOwnerEntryFrm!OwnerZip")
Forms!frmOwnerEntryFrm!OwnerState = DLookup("State", "tblZipCodes",
"Zip=Forms!frmOwnerEntryFrm!OwnerZip")

ExitOwnerZip_AfterUpdate:
Exit Sub

NotFound:
ZipNotFoundFlag = True '' (global to this form module) Zip
code entered was NOT found in the table
'' You may wish to incorporate the AddZipBtn that you used on
cust-entry form in Credi-Clean
MsgBox "ZipCode not found - enter city and state manually.", 48,
"Not in zip list - " & MyApp$ & ", rev. " & MY_VERSION$
Dim MyControl As Control
Set MyControl = Forms!frmOwnerEntryFrm!OwnerCity
DoCmd.GoToControl MyControl.Name
Exit Sub

OwnerZip_AfterUpdateErr:
If Err = 2448 Then GoTo NotFound ''2448 = Can''t Set Value error
Dim r As String, k As String, Message3 As String
r = "The following unexpected error occurred in Sub
OwnerZip_AfterUpdate, CBF on " & ThisForm & "."
k = CRLF & CRLF & str$(Err) & ": " & Quote & Error$ & Quote
Message3 = r & k
MsgBox Message3, 48, "Unexpected Error - " & MyApp$ & ", rev. " &
MY_VERSION$
Resume ExitOwnerZip_AfterUpdate

End Sub

I don''t think I refer to any table fields in the procedure as
''OwnerCity''

解决方案




这篇关于A97错误#2109?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 06:14