当使用键匹配字段找不到记录时,我将使用哪个事件 [英] Which event do I use when a record can't be found with key matching fields

查看:130
本文介绍了当使用键匹配字段找不到记录时,我将使用哪个事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在访问2002年。我有三张桌子:

1-区数据(学号,姓名,等级等)

2- Rosters (RRec ID,校园,教师ID)

3-名册上的学生(SRec ID,RRec ID,学生证)


还有1到罗斯特和名册上的学生之间的许多关系。我创建了一个表单和子表单来填充名单上的名单和学生。


名册上的学生子表单只接受学生ID(数据表格式),如果找到学生在区数据表中,它在屏幕上显示其数据。我根据学生证在名单上创建了区数据和学生之间的关系。


我没有故意使用组合框,因为我想确保数据录入工作人员验证与学生ID相关的数据。


我的问题是,当学生不在区数据表上时(在表格中找不到记录区域数据与密钥匹配字段学生ID)。我想启动数据输入屏幕(对话框模式中的另一种形式)来收集区域数据表的数据并将其传递回原始表单以供显示。我使用什么事件?


我发现了很多使用组合框和NotInList事件,但这会导致错误,因为它预先填写了学生ID字段。


我是VB的新手。 :-(任何帮助将不胜感激。

I''m working in access 2002. I have three tables :
1- District Data (Student ID, name, grade, etc)
2- Rosters (RRec ID,Campus, Teacher ID)
3- Students on Roster(SRec ID, RRec ID, Student ID)

There''s a 1 to many relationship between Rosters and Students on Roster. I created a form and subform to populate the Rosters and Students on Roster.

The Students on Roster subform simply accepts the Student ID''s (datasheet format) and if the student is found in the District Data table it displays their data on the screen. I created a relationship between District Data and Students on roster based on Student ID.

I did not use a combo box on purpose, since I want to make sure the data entry clerk verifies the data associated with the student id.

My problem is that when the student is not on the District Data table (cannot find record in the table District Data with key matching field(s) Student ID). I want to launch a data entry screen (another form in dialog mode) to collect the data for the District Data table and pass it back to the original form for display. What event do I use?

I have found quite a bit using combo boxes and the NotInList event, but that will allow for error since it prefills the student id field.

I am a VB newbie. :-( Any help will be greatly appreciated.

推荐答案

你用什么来确定[区数据]表中是否有匹配的记录(DLookup;已链接) fields;在RecordSource查询中)?
What are you using to determine if there is a matching record in the [District Data] table (DLookup; Linked fields; Within the RecordSource query)?



你用什么来确定[区数据]表中是否有匹配的记录(DLookup;链接的字段;在RecordSource查询中)?
What are you using to determine if there is a matching record in the [District Data] table (DLookup; Linked fields; Within the RecordSource query)?



我不知道怎么做DLookup。我在区数据和名册中的学生之间有关系基于学生证。我使用学生名册中的学生ID字段构建了Form1,并从学区ID中提取了区数据的相应字段。当它在区数据中找不到相应的记录时(错误 - 找不到记录)表区域数据与密钥匹配字段学生ID),我想启动新的Form2,让他们有机会添加它,然后回到原来的Form1继续输入更多的学生。

I don''t know how to do DLookup. I have a relationship between District Data and Students in Roster based on Student ID. I built Form1 using the Student ID field in Students in Roster and pulled the corresponding fields from District Data for that Student ID. When it can''t find the corresponding record in District Data (error - cannot find record in the table District data with key matching field(s) Student ID), I want to launch the new Form2 to give them an opportunity to add it and go back to the original Form1 to continue entering more students.


我得到了你想要的东西,但直到我理解你是如何得到那个错误信息我不能告诉你怎么做。我知道它不是DLookup(),但它是什么?
I get what you want, but until I understand how you''re getting that error message I can''t tell you how to do it. I get that it''s not DLookup(), but what is it?


这篇关于当使用键匹配字段找不到记录时,我将使用哪个事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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