K
Kenneth
I have a small database with two main tables called Exams and Action Steps.
The relationship between the two tables is that a Exam can have 0 to many
Action Step records, and a Action Step can have 0 or 1 exam. I've created
two forms for entry one for exams and one for action steps. I'm having a
problem on the action step form. The action step table holds the link
between the two tables (exam id which is a unique identifier of exams). What
I'm trying to do is when a user enters that exam id onto the action step
form, I need it to pull information from the exam table on to the action step
form. This is not redundant saving, these values would be more like defaults
for the action step, but not necessarily what the action step needs. I've
been able to fill in those values when there is a match in the exam table.
However, when there isn't a match, I get a error stating "the value you
entered isn't valid for this field." I've setup a macro on the action steps
table in the afterupdate event. The macro reads from a subform I've created
and hidden on the action steps form. The subform comes from the exam table
and has the values I need on the main action steps form. The macro goes from
setting focus on the field it needs to get the value of to using a SetValue
to get the value from the subform. I'm guessing there's an easier way to do
this, but it works when there is a exam id match. Is there any way to ignore
the error that comes up when there isn't a match?
The relationship between the two tables is that a Exam can have 0 to many
Action Step records, and a Action Step can have 0 or 1 exam. I've created
two forms for entry one for exams and one for action steps. I'm having a
problem on the action step form. The action step table holds the link
between the two tables (exam id which is a unique identifier of exams). What
I'm trying to do is when a user enters that exam id onto the action step
form, I need it to pull information from the exam table on to the action step
form. This is not redundant saving, these values would be more like defaults
for the action step, but not necessarily what the action step needs. I've
been able to fill in those values when there is a match in the exam table.
However, when there isn't a match, I get a error stating "the value you
entered isn't valid for this field." I've setup a macro on the action steps
table in the afterupdate event. The macro reads from a subform I've created
and hidden on the action steps form. The subform comes from the exam table
and has the values I need on the main action steps form. The macro goes from
setting focus on the field it needs to get the value of to using a SetValue
to get the value from the subform. I'm guessing there's an easier way to do
this, but it works when there is a exam id match. Is there any way to ignore
the error that comes up when there isn't a match?