语法问题 - 当strlinkcriteria是一个数字时 [英] Syntax issue - when strlinkcriteria is a number

查看:89
本文介绍了语法问题 - 当strlinkcriteria是一个数字时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个代码可以正常工作并将表单打开到正确的记录但它会产生类型不匹配。 msgbox打开记录...

stLinkCriteria由两个值组成,其中一个是数字[AAID] - 是导致这种情况的语法吗?


********************************************** **** ****************************************** *

I have this code which works fine and will open the form to the correct record but it produces a "Type mismatch" msgbox on opening the record...

the stLinkCriteria consists of two values one of which is a number [AAID] - is the syntax causing this?

************************************************** ******************************************

展开 | 选择 | Wrap | 行号

推荐答案

是的,我相信由于AAID是数字,你必须用字符串(str)包装它功能如图所示:

stLinkCriteria = Str(" [AAID] =& Me![lstEMPs] .Column(0))& " AND [部门] =''" &安培;我![lstEMPs] .Column(1)& "''"
Yes, I believe that since AAID is numeric, you have to wrap it with the string (str) function as shown:

stLinkCriteria = Str("[AAID] =" & Me![lstEMPs].Column(0)) & " AND [Department]=''" & Me![lstEMPs].Column(1) & "''"



是的,我相信由于AAID是数字,你必须用字符串(str)包装它功能如图所示:

stLinkCriteria = Str(" [AAID] =& Me![lstEMPs] .Column(0))& " AND [部门] =''" &安培;我![lstEMPs] .Column(1)& ""
Yes, I believe that since AAID is numeric, you have to wrap it with the string (str) function as shown:

stLinkCriteria = Str("[AAID] =" & Me![lstEMPs].Column(0)) & " AND [Department]=''" & Me![lstEMPs].Column(1) & "''"



是的,但语法不是:


stLinkCriteria =" [AAID] =" &安培; str(Me![lstEMPs] .Column(0))& " AND [部门] =''" &安培;我![lstEMPs] .Column(1)& "''"


Yes, but wouldn''t the syntax be:

stLinkCriteria = "[AAID] =" & str(Me![lstEMPs].Column(0)) & " AND [Department]=''" & Me![lstEMPs].Column(1) & "''"

?


Puppydogbuddy?你的代码产生错误msgbox?类型不匹配?一旦你点击按钮并且没有打开表格


evn678?你的代码与我的原始代码做了同样的事情?它打开表格到正确的记录但仍然产生错误msgbox?


???
Puppydogbuddy ? your code produces the error msgbox ?Type mismatch? as soon as you click the button and doesn?t open the form

evn678 ? your code does the same thing as my original code ? it opens the form to the correct record but still produces the error msgbox?

???


这篇关于语法问题 - 当strlinkcriteria是一个数字时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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