Command Buttons

S

Slej

I've been trying to resolve this problem for weeks and I
haven't been successful. I have a main form
(PARTICIPANTS) with a subform (REGISTRATIONS). I need to
add 12 command buttons to the REGISTRATIONS form. Each
button opens a unique form. The forms the buttons open
need to set the value of four fields (PARTICIPANT ID,
REGISTRATION ID, FIRST NAME, & LAST NAME) equal to the
value from the REGISTRATION form.

For example: John Doe has a participant ID = 110. He is
registered in Event A with a registration ID of 20. It
is now time to enter the results of Test 1 for John Doe
for this particular event - Event A (with the
registration ID of 20). The button on the REGISTRATIONS
form that will call the TEST 1 form needs to populate its
PARTICIPANT ID, REGISTRATION ID, FIRST NAME, & LAST NAME
fields with the same information from the preceeding
registration form (that is: participant ID = 110,
registration ID = 20, first name = John, and last name =
Doe). I have the control source for these controls set
to be equal to that in the REGISTRATIONS table but that
doesn't seem to work.

It seems like there should be a simple way to do this but
I can't figure it out. Thank you.

- Sharon
 
T

Treebeard

Slej said:
I've been trying to resolve this problem for weeks and I
haven't been successful. I have a main form
(PARTICIPANTS) with a subform (REGISTRATIONS). I need to
add 12 command buttons to the REGISTRATIONS form. Each
button opens a unique form. The forms the buttons open
need to set the value of four fields (PARTICIPANT ID,
REGISTRATION ID, FIRST NAME, & LAST NAME) equal to the
value from the REGISTRATION form.

For example: John Doe has a participant ID = 110. He is
registered in Event A with a registration ID of 20. It
is now time to enter the results of Test 1 for John Doe
for this particular event - Event A (with the
registration ID of 20). The button on the REGISTRATIONS
form that will call the TEST 1 form needs to populate its
PARTICIPANT ID, REGISTRATION ID, FIRST NAME, & LAST NAME
fields with the same information from the preceeding
registration form (that is: participant ID = 110,
registration ID = 20, first name = John, and last name =
Doe). I have the control source for these controls set
to be equal to that in the REGISTRATIONS table but that
doesn't seem to work.

It seems like there should be a simple way to do this but
I can't figure it out. Thank you.

- Sharon

Private Sub Test1ResultsButton_Click()
Dim StrCriteria As String
StrCriteria = "[PARTICIPANT ID] = " & Me.PARTICIPANT_ID & " AND
[REGISTRATION ID] = " & Me.REGISTRATION_ID
DoCmd.OpenForm "TEST1 RESULTS ", , , StrCriteria

End Sub

The control source for the form "TEST1 RESULTS" should be a join of the
tables PARTICIPANTS & REGISTRATIONS.
i.e.
Select * FROM PARTICIPANTS , REGISTRATIONS WHERE PARTICIPANTS.[PARTICIPANT
ID] = REGISTRATIONS.[PARTICIPANT ID] ;

Although I don't understand why you can't just enter in the test results
directly into the REGISTRATIONS subform.

How many tables are part of this senario?

Jack

Jack
 
S

Slej

Jack,

Thank you for responding. The reason why I don't just
enter the test results directly into the REGISTRATIONS
subform is, there are 12 forms in total that have to
connect to any one registration ID. Entering all of that
data or inserting each of the forms as a subform to
REGISTRATIONS would be too messy and not user friendly.
That's why I was hoping to use command buttons to access
each of the forms.

I will try the code you suggested and let you know what
happens. Thanks.

- Sharon
-----Original Message-----

I've been trying to resolve this problem for weeks and I
haven't been successful. I have a main form
(PARTICIPANTS) with a subform (REGISTRATIONS). I need to
add 12 command buttons to the REGISTRATIONS form. Each
button opens a unique form. The forms the buttons open
need to set the value of four fields (PARTICIPANT ID,
REGISTRATION ID, FIRST NAME, & LAST NAME) equal to the
value from the REGISTRATION form.

For example: John Doe has a participant ID = 110. He is
registered in Event A with a registration ID of 20. It
is now time to enter the results of Test 1 for John Doe
for this particular event - Event A (with the
registration ID of 20). The button on the REGISTRATIONS
form that will call the TEST 1 form needs to populate its
PARTICIPANT ID, REGISTRATION ID, FIRST NAME, & LAST NAME
fields with the same information from the preceeding
registration form (that is: participant ID = 110,
registration ID = 20, first name = John, and last name =
Doe). I have the control source for these controls set
to be equal to that in the REGISTRATIONS table but that
doesn't seem to work.

It seems like there should be a simple way to do this but
I can't figure it out. Thank you.

- Sharon

Private Sub Test1ResultsButton_Click()
Dim StrCriteria As String
StrCriteria = "[PARTICIPANT ID] = " & Me.PARTICIPANT_ID & " AND
[REGISTRATION ID] = " & Me.REGISTRATION_ID
DoCmd.OpenForm "TEST1 RESULTS ", , , StrCriteria

End Sub

The control source for the form "TEST1 RESULTS" should be a join of the
tables PARTICIPANTS & REGISTRATIONS.
i.e.
Select * FROM PARTICIPANTS , REGISTRATIONS WHERE PARTICIPANTS.[PARTICIPANT
ID] = REGISTRATIONS.[PARTICIPANT ID] ;

Although I don't understand why you can't just enter in the test results
directly into the REGISTRATIONS subform.

How many tables are part of this senario?

Jack

Jack



.
 

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