By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,530 Members | 880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,530 IT Pros & Developers. It's quick & easy.

Open form to most recently viewed record

P: n/a
Hi all,

Here's my case:

I have a form: Event Form

and a subform: AttendanceSubForm

The user selects a name (from a Person Table) on the subform to
register for the event. If the name is not there, they are to click a
command button (which is currently placed on the form) to open up the
Person Form.

Once the person is added, the Person Form is closed. However, the name
list on the subform is not refreshed.

My approach is to make the control button to open the Person form also
close the Event Form and AttendanceSubForm. Then, when the Person form
is closed, use a specific button that also reopens the Event form and
Attendance Subform.

The only problem is that I don't know how to get back to the Event
Record I was previously working on. I can't use last added record: If
I base it on the Event Form, I get the last added event. If I base it
on the subform, I have to open it first, and it opens in it's own
window. And, what if I haven't added anyone to that Event yet anyway?

So...

Either - Can anyone give me ideas about how to open the last viewed
Event Record

Or - Does anyone have another way to approach the problem?

Thanks a billion! (An American billion, to boot! Points if you know
the difference.)

- Melissa

Aug 9 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Rather than closing and opening forms, it makes more sense to REQUERY
the forms based on the contents of your combo box. Look into the
RecordSource property of forms.

pi*******@gmail.com wrote:
Hi all,

Here's my case:

I have a form: Event Form

and a subform: AttendanceSubForm

The user selects a name (from a Person Table) on the subform to
register for the event. If the name is not there, they are to click a
command button (which is currently placed on the form) to open up the
Person Form.

Once the person is added, the Person Form is closed. However, the name
list on the subform is not refreshed.

My approach is to make the control button to open the Person form also
close the Event Form and AttendanceSubForm. Then, when the Person form
is closed, use a specific button that also reopens the Event form and
Attendance Subform.

The only problem is that I don't know how to get back to the Event
Record I was previously working on. I can't use last added record: If
I base it on the Event Form, I get the last added event. If I base it
on the subform, I have to open it first, and it opens in it's own
window. And, what if I haven't added anyone to that Event yet anyway?

So...

Either - Can anyone give me ideas about how to open the last viewed
Event Record

Or - Does anyone have another way to approach the problem?

Thanks a billion! (An American billion, to boot! Points if you know
the difference.)

- Melissa
Aug 9 '06 #2

P: n/a

ManningFan wrote:
Rather than closing and opening forms, it makes more sense to REQUERY
the forms based on the contents of your combo box. Look into the
RecordSource property of forms.
Thanks for the reply... I'm trying to get it, but it's not quite making
sense to me.

Where in the RecordSource property of forms do I specify to REQUERY the
form? Does it have to be an event procedure? Do I have to put a
"refresh" button for the user to click?

Thanks,

Melissa

Aug 9 '06 #3

P: n/a
pi*******@gmail.com wrote in
news:11*********************@m79g2000cwm.googlegro ups.com:
>
ManningFan wrote:
>Rather than closing and opening forms, it makes more sense to
REQUERY the forms based on the contents of your combo box.
Look into the RecordSource property of forms.

Thanks for the reply... I'm trying to get it, but it's not
quite making sense to me.

Where in the RecordSource property of forms do I specify to
REQUERY the form? Does it have to be an event procedure? Do
I have to put a "refresh" button for the user to click?

Thanks,

Melissa
You don't put it in the RecordSource property of the form..
Essentially you want to requery the Recordsource of the
Combobox. And you would issue the requery command once you have
finished entering the data on the Persons form.

You leave the Event form Open and open the Persons form. enter
the record, and requery the combobox on the Attendance subform
Put Forms!Event!Attendance.form!Combobox requery
and me.close
as the statements in the On Click event of the button that
closes the Persons form
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 9 '06 #4

P: n/a
You would put code on the button to refresh the recordsource of your
subforms. For example:

Forms!frmSomeForm.RecordSource = "Select * from SomeTable where
SomeField = ' " & Me.ComboBox & " ' "

Forms!frmSomeForm.Requery

pi*******@gmail.com wrote:
ManningFan wrote:
Rather than closing and opening forms, it makes more sense to REQUERY
the forms based on the contents of your combo box. Look into the
RecordSource property of forms.

Thanks for the reply... I'm trying to get it, but it's not quite making
sense to me.

Where in the RecordSource property of forms do I specify to REQUERY the
form? Does it have to be an event procedure? Do I have to put a
"refresh" button for the user to click?

Thanks,

Melissa
Aug 10 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.