变量未定义存在的字段的错误? [英] variable not defined error for field that exists?

查看:105
本文介绍了变量未定义存在的字段的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MySQL后端和Access前端。我的一个MySQL表有三个字段,全部定义为微小的整数,没有空值,默认为0,字段宽度为2.

在我的表单上,我有三个复选框,每个复选框链接到三个字段。我在更新后每个都有完全相同的代码:

展开 | 选择 | Wrap | 行号

解决方案

如果我创建一个空白表单并添加一个复选框,将控件源设置为相关字段,然后进入它显示的VBA编辑器?和工作?所以我的形式明确地禁止它工作吗?


我打赌你使用的是Option Explicit而你没有对变量进行delcare ......


< blockquote>是和是,虽然字段名称是变量?我还没有在任何地方宣布任何东西,但其他所有人都在工作? dpr_vehicle,dpr_safety和dpr_work都是MySQL数据库中的微小int字段。 dpr_vehicle和dpr_safety的代码工作得很好。


我的一个同事制作了数据库的副本并在他的机器上打开它并且能够让它工作没有问题。所以我们已经替换了文件,但我仍觉得它很奇怪?


I am using a MySQL back end and Access front end. One of my MySQL tables has three fields all defined as tiny ints, no nulls, default 0, field width 2.

On my form I have three checkboxes, each linked to the three fields. I have the EXACT SAME CODE for each after update:

Expand|Select|Wrap|Line Numbers

解决方案

If I create a blank form and add a checkbox, set the control source to the field in question, then go into the VBA editor it shows up? and works? So something is explicitly in my form that prevents it from working?


I bet you are using Option Explicit and you did not delcare the variable...


Yes and yes, although is a field name a variable? I haven''t declared anything anywhere and yet all the others work? dpr_vehicle, dpr_safety, and dpr_work are all tiny int fields in the MySQL db. The code for dpr_vehicle and dpr_safety work just fine.

One of my coworkers made a copy of the database and opened it on his machine and was able to get it to work with no problem. So we''ve replaced the file, but I still find it to be very strange?


这篇关于变量未定义存在的字段的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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