Using Command Button To Open A Form

  • Thread starter Thread starter Sharon
  • Start date Start date
S

Sharon

SCENARIO
1. Form #1 = Registrations
2. Form #2 = 6th Grade Pre-Test
3. both forms have a Registration ID field and it is the
key field in both tables
4. there is a button on Form 1 to access Form 2 (sub-
forms won't be efficient for this situation)
5. when Form 2 is accessed, the Registration ID from
Form 1 correctly populates the Registration ID for Form 2
6. enter student's test score in the Score field on Form
2
7. save and close form

PROBLEM
Entering the score for Student #1 is okay. When I go to
Student #2, this is what happens:

1. the correct ID is populated in Form 2
2. but the last student's test score appears in the
Score field
3. the message bar indicates this is record 1 of 1

If I click the New Record button, the message changes to
2 of 2. The Score field also comes back blank (the ID
field remains equal to Student #2's ID - which is okay).
If I enter Student #2's test score and save and close the
form, the corresponding table for Form 2 shows 2 records
with two different scores BUT both records will have the
Registration ID of Student #2.

I don't know why this is happening. I tried a couple of
different things but nothing works. I'm guessing it has
something to do with either:

1. the table relationships
2. the type of join
3. when the button was created, the button wizard asks
whether or not the button should display all records or a
specific record (I've tried it both ways)
4. a combination of the above

If I populate the table WITHOUT using the form,
everything is okay which leads me to conclude I must have
done something in the form design but I can't narrow it
down. Hopefully, someone will be able to offer me some
advice. Thanks.

- Sharon
 
Uh. It is very difficult in my opinion to make multiple related forms
work together relying on just wizards to manage the data. You should go
into the VBA editor and make sure that the button that opens the 2nd
form does what it should.
It is very difficult to recommend a solution without more details. For
example, when you say "form 2 is accessed", it does not really say how
it all happens, and there is more than one way to make it happen. If you
can temporarily post the design on the web, it might be easier to help you.

Good luck,
Pavel
 
Back
Top