473,326 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Open form to most recently viewed record

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
4 3115
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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Martin | last post by:
Again drawing on the groups experience:- 1. For general file opening and file saving, using VB6, are there any issues with using the FileOpen and FileSave Common Dialog Boxes? 2. Is using the...
6
by: John | last post by:
Just a general question... I'm currently using a combobox that when updated, opens a form with its recordset based on a query using the combo box value as the criteria. I'm I correct in...
1
by: Richard | last post by:
Thats a mouthfull of a title what I'm after should be really simple. I have a form with a subform which itself has a subform the final subform contains an individuals record. The individuals...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
3
by: sea | last post by:
I need to be able to print the current form because the form has an embedded object of a .gif file, so report will not work -- does anyone know the way to do this? I tried some code, not sure what...
1
by: Angus | last post by:
Hello My question is a general web programming question I suppose. We have a call centre web application which receives data from the telephone system. I initially thought that Java -...
14
by: keri | last post by:
Hi, Simple version of the question..... How do I use the where clause of the open form command to show an account with a matching ID to be displayed when the form is opened? Eg. I select a...
3
by: chuch | last post by:
Hi, i have created a database to store contractors invoices. I have approximately 9 tables and 3 forms. One of my forms(frmContractors) has all the contractor details and this also contains a sub...
7
by: GraemeC | last post by:
I have a form (single record form) that loads records from a query that are sorted date order as the records are viewed in date order. Some dates are in the past and some are in the future. Currently...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.