如何使用"if"中的条件创建表格?检查数据库表中的数据? [英] how to create a form using the conditions in "if" to check the data in database tables?

查看:131
本文介绍了如何使用"if"中的条件创建表格?检查数据库表中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在访问中创建一个报告,该报告是在检查表中是否已完成批准(数据类型-是/否)之后生成的,换句话说,我想在vba中使用"if"来检查表元素中的条件

例如:

i want to create a report in access which is generated after checking if approval(data type-yes/no) has been done in table in other words i want to use "if" in vba which checks conditions in the table elements

eg:

if(table1.column has condition1) then
some code
endif

推荐答案

要求:具有3个字段的表"Employees":[名称]-文本(30),[姓氏]-文本(50),[作业] ]-文本(50)
1)复制代码:
Requirements: Table "Employees" with 3 fields: [Name] - text(30), [Surname] - text(50), [Job] - text(50)
1) Copy code:
SELECT [Name] & " " & [Surname] As [Employee], IIf([Job]="Manager","yes","no") As [Manager]
FROM Employees


2)打开查询编辑器窗口并粘贴复制的代码.

如果此代码不正确,则将,"替换为;"在IIf()语句中.


2) Open query editor window and paste copied code.

If this code is not correct, replace "," with ";" in IIf() statement.


这篇关于如何使用"if"中的条件创建表格?检查数据库表中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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