尝试在表单上创建一个按钮,从文本框中将信息添加到表中。 [英] Trying to make a button on a form add information into a table from textboxes.

查看:83
本文介绍了尝试在表单上创建一个按钮,从文本框中将信息添加到表中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我一直在研究数据库,到目前为止一切顺利。我有14个文本框连接到一个按钮,该按钮搜索您搜索的查询(附加到表格)。它完美地工作......虽然我想为这个数据库增加一个功能;这是一个添加按钮。如果您在相同的文本框中输入信息,然后单击添加按钮而不是搜索按钮,它将添加一个字段,其中包含您在表格中输入的所有信息,这样查询就可以查看它,您可以搜索它在以后的时间。


要在我们面前看到我的意思,为了更好地了解正在发生的事情等,下载到我的数据库下面。 />

请忽略CustomersT,因为我在桌子上鬼混,100%不需要。


表名:OrderT

查询名称:SearchQ

表格:SearchF

文本框名称:

- 商业名称

- DateOfPurchase

- CutplanDueDate

- HardwareSpecs

- PurchaseOrder

- OrderName

- EngineerDueDate

- MaterialSpecs

- HardwareDueDate

- PurchaseSupplier

- OrderDesc

- ProjectComplete

- CutplanCode

- HardwareComplete

FieldNames:

全部与上面的文本框名称相同。

按钮名称:Command344


Windows 7

Windows Access 2013

如果您需要更多信息,请询问。



Hello, I have been working on a database and so far it''s going well. I have 14 text boxes that are hooked up to a button that searched a query (which is attached to a table) for what you searched. It works perfectly... though I''d like to add one more feature to this database; and that is an add button. Where if you enter information into those same text boxes, and click the add button instead of the search button it''ll add a field with all that information you entered into the table, which lets the query see it and you can search for it at later times.

To see exactly what I mean in front of you, to get a better understanding of what is going on and such, the download is below to my database.

Please ignore CustomersT as it was me fooling around with tables and is 100% not needed.

Table name: OrderT
Query Name: SearchQ
Form: SearchF
Textbox Names:
- BusinessName
- DateOfPurchase
- CutplanDueDate
- HardwareSpecs
- PurchaseOrder
- OrderName
- EngineerDueDate
- MaterialSpecs
- HardwareDueDate
- PurchaseSupplier
- OrderDesc
- ProjectComplete
- CutplanCode
- HardwareComplete
FieldNames:
All same as above text box names.
Button Name: Command344

Windows 7
Windows Access 2013

If you need more information, please ask.

附加文件
PCResale.zip (870.5 KB,62 views)
Attached Files
PCResale.zip (870.5 KB, 62 views)

推荐答案

你真的不应该允许您的用户在表中创建字段。它很快就会成为一场噩梦。如果要使用注释字段或允许用户使用另一个表将标记添加到记录,则可以执行此操作。但永远不允许用户更改数据库结构。
You really should not allow your users to create fields in your tables. It will quickly become a nightmare. If you want to use a comment field or allow the users to add tags to a record by using another table, then you can do that. But never allows users to change the database structure.


这是一种让用户更容易编辑它的方法,因为数据库将具有登录功能只有管​​理员才能使用。无论哪种方式我们都会向数据库添加数据,我只想拥有这个功能,所以一切都比每次都要直接来源添加数据更容易。
Well it''s more of a way to make it easier for the user to edit it, as the database will have a log on feature that only administrators can use. Either way we will be adding data to the database, I just want to have this feature so everything is easier than having to go to the direct source to add the data each time.


嗯,如果管理员只使用它,那么要添加列,您可以运行ALTER TABLE ADD命令。
Well, if it''s only being used by administrators, then to add a column you can run an ALTER TABLE ADD command.
展开 | 选择 | 换行 | 行号


这篇关于尝试在表单上创建一个按钮,从文本框中将信息添加到表中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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