如何在MS Access 2007中导出空值 [英] How do I export null values in MS Access 2007

查看:89
本文介绍了如何在MS Access 2007中导出空值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个宏,我正在用VBA编写,它将导出一个文本文件。它在测试中运行良好,直到我开始添加具有空值的其他列。我需要包含空值。有任何建议吗?

解决方案

如果您告诉我们Macro正在导出什么类型的信息,那么获得问题的答案可能会有所帮助。我们在谈论日期,数字,文字吗?


哪些列包含Null数据?


另外,您收到错误了吗?错误格式化?

编辑:顺便说一句,您还没有列出您对MS Access / Functions等的熟悉程度。

那个正在说 - 检查Nz()函数。


我正在导出一个带有文本列和2个数字列的12列文件表。两种类型都包含空值。


我得到运行时错误''94''无效使用null。当我用空值注释列时,宏运行正常。


我已经在Access中使用了VBA 3年来生成报告。



我查看了Nz函数,但它似乎只在null的位置添加了一个零,我需要保留空值或至少空白。有什么建议?


而不是Nz函数中的0,你试过" ;?

展开 | 选择 | Wrap | 行号

I have a macro that I''m writing with VBA that will export a text file. It worked great in testing until I started adding additional columns with null values. I need the null values to be included. Any suggestions?

解决方案

It might be helpful to get answers to your question if you tell us what kind of information the Macro is exporting. Are we talking Dates, Numbers, Text?

What columns contain the Null data?

Also, are you getting an error? Mis-formatting?

Edit: By the way, you have not listed how familiar you are with MS Access / Functions, etc.
That being said - Check out the Nz() function.


I''m exporting a 12 column file table with text columns and 2 numeric columns. Both types contain nulls.

I''m getting a run-time error ''94'' Invalid use of null. The macro runs fine when I comment out the columns with the nulls.

I''ve been dabbling with VBA in Access off an on for 3 years to generate reports.


I looked at the Nz function but it seemed to only add a zero in the place of a null and I need to keep the nulls or at least blanks. Any suggestions?


Instead of 0 in the Nz function, did you try ""?

Expand|Select|Wrap|Line Numbers


这篇关于如何在MS Access 2007中导出空值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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