访问表单退出事件 [英] Access Form On Exit event

查看:59
本文介绍了访问表单退出事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好。


我有一个文本框'CMS ID'的On Exit事件,它填写数据输入表格中的数据,如果有可用的数据(从另一个表中提取数据
)在CMS ID上。) 该事件应该正常工作,但是如果从CMS ID中清除数据并输入新数据(如果CMS ID被错误地键入/错字),则信息不会像第一次输入数据时那样更新
表示CMS ID。


附加的是On Exit事件,它第一次正常工作,但如果更新CMS ID则不会更新。任何反馈或建议都将不胜感激。 
感谢您的时间。


我想添加CustomerFirstName,CustomerLastName,当CMS ID更改时,CustomerStreetAddress会更改它的First_Name,Last_Name,Address不改变/更新..如果有任何意义。





















< td nowrap ="nowrap"valign ="bottom"width ="248"style ="width:186.0pt;填充:0在5.4pt 0in 5.4pt;身高:15.0pt">

结束如果
























































































Private Sub CMS_ID_Exit(Cancel As Integer)



[Completed_By] = theUserName()



如果是IsNull([字母类型])那么



[Letter Type] .Value = Form.RecordSource



如果IsNull([First_Name])= True则



[First_Name] = CustomerFirstName]



结束如果



如果IsNull([Last_Name])= True则



    [Last_Name] = [CustomerLastName]



结束如果



如果IsNull([Address])= True则



    [地址] =    [CustomerStreetAddress]



结束如果



如果IsNull([City])= True则



    [City] = [CustomerCity]



结束如果



如果IsNull([State])= True则



    [State] = [CustomerState]



结束如果



如果IsNull([Zip_Code])= True则



    [Zip_Code] = [CustomerZipCode]



结束如果



如果IsNull([DNR_Date])= True则



    [DNR_Date] = [DueDateDD]



结束如果



End Sub






解决方案


不确定这是否有帮助,而不是Exit事件,也许您可​​以尝试使用文本框的AfterUpdate事件


Good morning.

I have an On Exit event for a text box 'CMS ID' that fills in data on a data entry form, if there is data available (pulling in data from another table based on the CMS ID).  The event works as it should however if the data is cleared from the CMS ID and new data is entered (in the event the CMS ID was keyed incorrectly / typo) the information does not update as it did the first time the data was entered for the CMS ID.

Attached is the On Exit event which works correctly the first time but does not update if the CMS ID is updated.. Any feedback or suggestions would be greatly appreciated.  Thank you for your time.

I do want to add the CustomerFirstName, CustomerLastName,CustomerStreetAddress does change when the CMS ID changes it’s the First_Name, Last_Name, Address that does not change / update.. if that makes any sense.

Private Sub CMS_ID_Exit(Cancel As Integer)

[Completed_By] = theUserName()

If IsNull([Letter Type]) Then

[Letter Type].Value = Form.RecordSource

End If

If IsNull([First_Name]) = True Then

[First_Name]=CustomerFirstName]

End If

If IsNull([Last_Name]) = True Then

    [Last_Name] =[CustomerLastName]

End If

If IsNull([Address]) = True Then

    [Address] =   [CustomerStreetAddress]

End If

If IsNull([City]) = True Then

    [City] = [CustomerCity]

End If

If IsNull([State]) = True Then

    [State] = [CustomerState]

End If

If IsNull([Zip_Code]) = True Then

    [Zip_Code] = [CustomerZipCode]

End If

If IsNull([DNR_Date]) = True Then

    [DNR_Date] = [DueDateDD]

End If

End Sub


解决方案

Hi,

Not sure if this will help but rather than the Exit event, maybe you could try using the textbox's AfterUpdate event.


这篇关于访问表单退出事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆