如何使用未绑定的表单删除记录 [英] How to delete a record using an unbound form

查看:52
本文介绍了如何使用未绑定的表单删除记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好日子!这就是我正在努力做的事情。我有一张桌子,我想让人们通过表格来操纵。我正在使用未绑定的表单,因为我不希望用户能够在没有验证的情况下添加/删除/编辑字段。对于我的删除表单,我想使用一个组合框,在表单加载事件期间加载第1列(序列号)中的所有项目。用户将选择一个项目并使用名为查找记录的命令按钮。我希望该按钮的click事件将相关记录中的其余字段填充到文本框中。然后,用户将使用删除记录。命令按钮删除记录。我已经宣布了记录集,我想我需要使用动态数组,但我发现这可能比我想象的更先进......有没有人有任何建议?

解决方案


" 我正在使用未绑定的表单,因为我不希望用户能够添加/删除/编辑没有验证的字段。"



我希望我知道白痴开始这个完全错误的谣言,关于需要未绑定的表格才能进行验证!


A使用Access进行数据库开发的大部分原因是使用绑定表单创建它的速度。我认识的几位在Visual Basic数据库开发和Access开发方面经验丰富的开发人员估计,经验丰富的开发人员使用未绑定表单进行开发所需的时间是使用Access和绑定表单时的两倍。


为了进行数据验证(通常给出的原因),未绑定表格是必要的,这根本不是真的!通过使用 Form_BeforeUpdate 事件轻松完成绑定表单上的验证


如果你坚持在使用未绑定的表单时,使用带有SQL Server或Oracle后端的直接VB或C ++前端会好得多。

  1. 您可以创建一个EXE文件,为您的代码/设计提供全面保护
  2. 您可以将数据库分发到PC而无需复制访问权限
  3. 您的数据安全性远远超过您在Access中可以做的任何事情



Linq ; 0)> ;


我认为诀窍是:


1.通过将表格拖入表格,将表格绑定到表格中形成并删除休息并留下所需的列。这会创建一个子表单。

为了防止用户编辑/修改显示的记录,设置启用:是和锁定:是

并设置导航按钮: sunform上没有


从现在开始,我认为用户不会接触任何按钮来编辑/修改记录。


To使用向导进行搜索,简单创建组合并按照提示进行操作,或者您可以创建基于表单的搜索。


只是一个想法那里......我很匆忙

对不起,现在已经很晚了......我需要回家......发表评论,我会正确看到这个2morow ..


像Linq一样,我是混淆为什么这么多成员认为围绕Access编码而不是使用Access来做它最擅长的事情,如分别在未绑定和绑定表单中,是某种更好的方法。如果您使用未绑定的表单,则缺少可用于帮助您验证操作员选择的大部分内容。我不得不说我的建议是使用绑定表格,如果你觉得有些漏洞不允许你按照你认为的那样做,那么可能会把它们作为问题提出来。我希望这里有人可以从那里指出你正确的方向。


否则,正如Linq所说,你也可以使用正确的编程语言。除非您利用Office功能,否则使用VBA几乎没有什么好处。


Good Day everyone! Here''s what I''m trying to do in a nutshell. I have a table that I want to allow people to manipulate via forms. I''m using unbound forms because I don''t want users to be able to add/delete/edit fields without validations. For my delete form, I want to use a combo box that loads up all of the items in column 1 (serial#) during the form load event. The user will pick an item and use a command button called "find record". I want the click event of that button to populate the rest of the fields in the related record to text boxes. Then the user will use a "delete record" command button to delete the record. I''ve declared the recordset, and I''m thinking I need to use a dynamic array, but I''m finding that this might be more advanced than I thought...does anyone have any suggestions?

解决方案

"I''m using unbound forms because I don''t want users to be able to add/delete/edit fields without validations."

I wish I knew what idiot started this completely false rumor about needing unbound forms in order to do validation!

A big part of the reason to use Access for database development is the speed with which it can be created, using bound forms. Several developers I know, experienced in Visual Basic database development and Access development, estimate that development using unbound forms by experienced developers takes twice as long as it does when using Access and bound forms.

The belief that unbound forms are necessary in order to do data validation (the reason usually given) is simply not true! Validation on bound forms is easily done thru use of the Form_BeforeUpdate event.

If you insist on using unbound forms, you''d be far better off using a straight VB or C++ front end with a SQL Server or Oracle back end.

  1. You can create an EXE file which gives total protection to your code/design
  2. You can distribute the db to PCs without a copy of Access being on board
  3. Your data security if far, far better than anything you can do in Access


Linq ;0)>


I think the trick is this:

1.Keep the form bound to the table by dragging the table into the form and delete rest and leave the desired columns. This creates a sub form.
To keep users away from editing/modifying the displayed records,set Enable: Yes and Locked: Yes
and also set the Navigation Buttons:NO on the sunform

From now I do not think the users will be exposed to any buttons to edit/modify the records.

To do the search, simple create combo using wizard and follow prompts or you can create a form based search.

Just an idea there..I am quite rushing

Sorry its late now..I need to go home..post comment and I''ll properly see into this 2morow..


Like Linq, I''m confused as to why so many members feel that coding around Access, rather than using Access to do what it does best, as in unbound and bound forms respectively, is somehow a better approach. If you use unbound forms then much of what is available to help you validate the operator choices is missing. I have to say my advice would be to use bound forms, and if you feel there are holes that don''t allow you to do as you think is right, then perhaps raise those as questions. I expect there are people here who can point you in the right direction from there.

Otherwise, as Linq says also, you may as well be using a proper programming language. There''s little benefit to using VBA unless you take advantage of the Office functionality.


这篇关于如何使用未绑定的表单删除记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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