本文介绍了在ACCESS检查格式是否正确之前拦截字段内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够在访问尝试验证字段中的数据是否为正确格式之前拦截和分析货币字段的内容。 具体来说,我需要能够输入类似"7.94 / 3"的内容。并在现场显示和保存
$ 2.65。 我知道如何解析文本和数学 但我只需要知道如何捕获字符串。 也许如果我知道ACCESS显示消息的错误代码,我可以停止消息并捕获
字符串,即使那时我会在哪个事件中放置错误陷阱代码?  

I need to be able to intercept and analyze the content of a Currency field BEFORE Access tries to validate that the data in the field is the proper format.  Specifically I need to be able to enter something like "7.94 / 3"  and have $2.65 displayed and saved in the field.  I know how to do the parsing of the text and the math  but I just need to know how to capture the string.  Maybe if I knew the error code for the message ACCESS displays I could stop the message and capture the string even then in which event would I place the error trap code?  

推荐答案

您可以通过Form的Error事件捕获大多数系统错误。希望有所帮助......

You can trap most system errors through the Form's Error event. Hope that helps...


这篇关于在ACCESS检查格式是否正确之前拦截字段内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 20:04