将附加查询更改为要在Access中运行的代码 [英] Change an Append Query into code to run in Access

查看:100
本文介绍了将附加查询更改为要在Access中运行的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个追加查询,我希望将其添加到代码中,以便我可以添加一些变量。我很擅长Access和公平的代码,所以无论谁回答都会保持简单。谢谢。



...一直在网上搜索,大多数网站就像问某人的时间,他们告诉你如何制作手表。希望他们只是简单地给出一个简单或基本的答案,然后再建立它。



仍在寻找帮助。我只想进行一个简单的查询,并能够从一个模块运行它。







我有一个追加查询,它会在后端拉出带有日期的文件(...在文件名的后端...)。我想用vba(...访问代码)编写并稍微改一下,所以每次运行时我都不必输入新的文件名(...因为文件末尾的日期) 。然后运行一个模块(......或其他)将新数据附加到主表。我很惊讶帮助网站如何使最简单的事情变得如此复杂。



查询

I have an append query that I would love to put into code so that I can add a few variables. I'm good with Access and fair with code so hopefully whoever answer will keep it simple. Thanks.

...been searching the web and most sites would be like asking someone the time and they tell you how to build a watch. Wish they would simply give a simple or basic answer and then build on it.

Still looking for help on this. I just want to take a simple query and be able to run it from a module.



I have an append query that pulls files with a date on the back end (...on the back end of the file name). I want to write in vba (...Access code) and change it a little so I don't have to type in the new file name (...because of the date at the end of file) every time I run it. Then run a module (...or whatever) to append the new data to the master table. I'm shocked at how "help" web sites can make the simplest thing so complex.

The query

INSERT INTO tblDataMaster 
( 
IDNumber, 
[Date], 
Firstname, 
Lastname 
)
SELECT 
tblDataMaster.IDNumber, 
tblDataMaster.Date, 
tblDataMaster.Firstname, 
tblDataMaster.Lastname
FROM tblDataMaster;

推荐答案

有一个看这里:

在VBA中组合访问表 [ ^ ]

附加访问表名称 [ ^ ]
Have a look here:
Combine Access Tables in VBA[^]
Append an Access table name[^]


这篇关于将附加查询更改为要在Access中运行的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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