单击命令按钮,将父ID传递给表时,向多个表添加新记录 [英] Add new record to multiple tables, when command button clicked, passing parent ID to tables

查看:70
本文介绍了单击命令按钮,将父ID传递给表时,向多个表添加新记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好, 

我希望有人可以帮我解决这个问题,这可能很简单,但我是VBA编码的新手,很难过搞清楚这一点。

I'm hoping someone can help me with this question that is probably pretty easy but I'm new to VBA coding and am having hard time figuring this out.

我需要创建一个VBA语句,只需点击一下按钮就可以将记录插入到几个表(PhotosEvent,WaterQuantityEvent,DisturbanceEvent和WildlifeEvent)中。点击按钮创建"访问"按钮。具有"VisitID"的事件,
打开表格以供用户输入与访问有关的信息。 "VisitID"是所有上述事件表中的一个字段,我需要传递"VisitID"。在这些表格中创建新记录,从而将事件
ID与"VisitID"相关联。

I need to create a VBA statement that will insert records into several tables (PhotosEvent, WaterQuantityEvent, DisturbanceEvent, and WildlifeEvent) at the click of a button. The button click creates the "Visit" event with a "VisitID", opening a form for the user to enter information relating to the visit. The "VisitID" is a field in all the aforementioned event tables and I need to pass the "VisitID" to these tables, to create a new record, thereby associating the event ID with the "VisitID".

谢谢。

 

推荐答案

嗨。这应该很简单,但为什么每个事件都有一个单独的表格?如果需要添加新事件会发生什么?你需要添加一个新表吗?如果是这样,您可以考虑查看表结构设计,因为可能有更好的结构
Hi. This should be easy but why do you have a separate table for each event? What happens if need to add a new event? Do you have to add a new table? If so, you might consider reviewing your table structure design because there might be a better structure for you.


这篇关于单击命令按钮,将父ID传递给表时,向多个表添加新记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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