vba 创建 Access GUI 以与数据库交互

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25764191/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 04:29:43  来源:igfitidea点击:

Create Access GUI to interface with Database

sqlvbauser-interfacems-access

提问by Vaibhav Gupta

I'm looking to create a basic GUI using MS Access which will allow me to add some DB values. I was wondering if this would be easier using Access itself, VBA or another function like Macros through Excel. Basically I need to do the following.

我希望使用 MS Access 创建一个基本的 GUI,这将允许我添加一些 DB 值。我想知道通过 Excel 使用 Access 本身、VBA 或其他函数(如宏)是否会更容易。基本上我需要做以下事情。

  • Create UI to add new value to DB quickly (over manual input)
  • Create UI to extract updated information (SQL style) then output as graph format/ existing budgeting format
  • 创建 UI 以快速向数据库添加新值(通过手动输入)
  • 创建 UI 以提取更新的信息(SQL 样式),然后以图形格式/现有预算格式输出

A larger question to this would be is it worth it to use Access or is there an easier way to change the tables and extract the relevant information.

一个更大的问题是使用 Access 是否值得,或者是否有更简单的方法来更改表和提取相关信息。

采纳答案by Mark C.

Out of the options you've listed, I would choose an MS Access front end.

在您列出的选项中,我会选择 MS Access 前端。

If multiple users (more than one) are going to be using this application, you're going to need an MS Access front end, and a back end (placed on a shared network/drive). You would then link the tables from the backend to the front end via linked table manager.

如果多个用户(不止一个)将使用此应用程序,您将需要一个 MS Access 前端和一个后端(放置在共享网络/驱动器上)。然后,您可以通过链接表管理器将后端的表链接到前端。

If you choose MS Access as a front end also, and you aren't familiar with SQL, it will be a little easier because of the QBE interface Access provides.

如果您也选择 MS Access 作为前端,并且您不熟悉 SQL,那么由于 Access 提供的 QBE 接口,它会更容易一些。

Access is not a verypowerful tool this day in age, but it is great for RAD (Rapid Application Development) for quick, hasty projects that are fairly simple (such as what you're describing the need for).

在当今时代,Access 并不是一个非常强大的工具,但它非常适合 RAD(快速应用程序开发)用于快速、仓促且相当简单的项目(例如您描述的需求)。

Creating forms is very simple in Access, and you can provide a direct link between a form and a table for adding, updating and deleting records via bound forms. You can also easily show data by providing a query (using SQL like you referenced) as the RecordSource for a form. You can even write VBA code to export your results to excel if that is necessary.

在 Access 中创建表单非常简单,您可以提供表单和表之间的直接链接,以便通过绑定表单添加、更新和删除记录。您还可以通过提供查询(使用您引用的 SQL)作为表单的 RecordSource 来轻松显示数据。如果有必要,您甚至可以编写 VBA 代码将结果导出到 excel。

If I didn't cover something that you're confused about, please let me know and I will update my answer.

如果我没有涵盖您感到困惑的内容,请告诉我,我会更新我的答案。