嵌套的IF语句不起作用 [英] Nested IF statements not working

查看:133
本文介绍了嵌套的IF语句不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在搜索表格。我有3个组合框,我想在查询中找到组合,以便稍后在报告中显示它。也许这太复杂了,但我不知道怎么做。我认为这段代码起初有效,但后来意识到它并没有真正起作用。我知道if语句有什么用,但我不知道如何修复它。

Hello,
I''m working on a search form. I have 3 combo boxes and I want to find combinations on a query to later show it in a report. Perhaps this is too complicated but I don''t know how else to do it. I thought this code worked at first, but then a realized it wasn''t really working. I know something is up with the if statements but I don''t know how to fix it.

展开 | 选择 | 换行 | 行号

推荐答案

当你说它没有按照它应该的方式工作时,你的意思是什么?是否有任何代码执行?


第一次测试:

When you say that it isn''t working how it''s supposed to, what do you mean by that? Is any of the code executing at all?

In the first test:

展开 | 选择 | Wrap | 行号


@ zepphead80


代码用于评估用户从2个下拉菜单中选择的组合是否存在于记录中(我正在使用查询显示记录)。如果它确实退出,那么它将打开一个名为'sales''的查询。如果它不存在,那么它将显示询问用户是否想要找到组合的消息。它还会问什么变量想要留下未知数。之后,代码找到组合,如果没有,它会要求添加一个新条目。


[公司名称]和[带公司]是查询''销售'中的字段名称'

谢谢!
@zepphead80
The code is suppose to evaluate if the combination chose by the user from 2 drop-down menus exist in the records (I''m using a query to show the records). If it does exits, then it will open up the a query called ''sales''. If it doesn''t exist then it will show a message asking if the user wants to find combinations. It''ll also ask what variable wants to left unknown. After that, the code finds the combination if there isn''t one, it''ll ask to add a new entry.

[company name] and [ribbon company] are the field names in the query ''sales''

thanks!


哦,它不起作用,因为它找不到记录,除非我从开始时或当它要求我找到组合时使这两个框不知道
oh, and it doesn''t work because it is not finding the record unless I make the two boxes unknown either from the begining or when it asks me to find combinations


这篇关于嵌套的IF语句不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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