Using one command button to open one of two forms

A

AccessIM

Thank you, Marsh. Sorry about the delay in getting back. This code works but
there is still one small problem.

When there is more than one record in the subform, I have to manually select
the record that I want to use. For example, there are two records in the
subform. One has a DISCIPLINE of "ATTENDANCE INFORMATION FORM" and the
second has a DICSIPLINE of "VERBAL WARNING". I am using a Yes/No check box
called REPRINT to identify which record I want to look at. When I click the
REPRINT check box on the first record with "ATTENDANCE INFORMATION FORM", the
rptAttendanceInformationFormReprint opens which is correct.

However, if I close the report and check the REPRINT box for the second
record that has "VERBAL WARNING" as the DISCIPLINE, it opens that record
information in rptAttendanceInformationFormReprint which is the incorrect
report for this discipline. It should open rptDisciplineReportReprint.

I noticed that anytime I click a different record's REPRINT box, the record
selector on the subform stays on the first record. If I manually move the
record selector to the second record, everything works perfectly.

How can I get the record selector to move to the record that I check to
reprint?

Thank you in advance!
 
A

Arvin Meyer [MVP]

Why don't you use a click event for the record that you are selecting?
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


AccessIM said:
Thank you, Marsh. Sorry about the delay in getting back. This code works
but
there is still one small problem.

When there is more than one record in the subform, I have to manually
select
the record that I want to use. For example, there are two records in the
subform. One has a DISCIPLINE of "ATTENDANCE INFORMATION FORM" and the
second has a DICSIPLINE of "VERBAL WARNING". I am using a Yes/No check
box
called REPRINT to identify which record I want to look at. When I click
the
REPRINT check box on the first record with "ATTENDANCE INFORMATION FORM",
the
rptAttendanceInformationFormReprint opens which is correct.

However, if I close the report and check the REPRINT box for the second
record that has "VERBAL WARNING" as the DISCIPLINE, it opens that record
information in rptAttendanceInformationFormReprint which is the incorrect
report for this discipline. It should open rptDisciplineReportReprint.

I noticed that anytime I click a different record's REPRINT box, the
record
selector on the subform stays on the first record. If I manually move the
record selector to the second record, everything works perfectly.

How can I get the record selector to move to the record that I check to
reprint?

Thank you in advance!
 
A

AccessIM

I think you mean I should key some code in the OnClick event of the check box
but i am very unfamiliar with code writing. Could you help me out as far as
what I would need to enter to make the record I click on be the active record
for determining what report to open?

Thank you in advance.

Arvin Meyer said:
Why don't you use a click event for the record that you are selecting?
 
A

AccessIM

I think you mean I should key some code in the OnClick event of the check box
but i am very unfamiliar with code writing. Could you help me out as far as
what I would need to enter to make the record I click on be the active record
for determining what report to open?

Thank you in advance.


Arvin Meyer said:
Why don't you use a click event for the record that you are selecting?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top