Refresh Results In A Second Subform In A Form

A

Ange Kappas

Hi,
This could be a tricky one.
What I've done is created a Form named ACCOUNTS SELECT which has a control
being a Comb Box named 'PICK RESNAME' and an embedded subform which returns
all the records according to the particular data from the 'PICK RESNAME'
Combo Box.
Thats all fine and well !
But what I need is to pick specific records and to store them in a let's say
temporary Table which I will print out via a Report. For this temporary
table, I have created in the Form ACCOUNTS SELECT another Subform which I
hoped will view all the selections I have made previously. In order for me
to store the selections I have made a Query Append which runs everytime I
make a selection with the Combo Box.

The problem is the Second Subform does not view the added on selections
unless I exit and enter the Form again. Maybe I can use some sort of Refresh
code?

Thanks
Ange
 
J

Jeanette Cunningham

Instead of running an append query, save your selections in a query.
For an example I will call the query qAccountSelections.

The second subfom's data source will be qAccountSelections
Hide the second subform until you have finished making all the selections,
then make it visible.

The report's data source will also be qAccountSelections

Jeanette Cunningham
 
A

Ange Kappas

Thanks Jeanette I understand the skeptic behind your proceedure, it woks,
just one more question if you don't mind, what code would I use so I can
incorporate it in my automations. By the way you have been a great help, and
my program is starting to work fine !!

Thanks
Ange
 
A

Ange Kappas

Hi Jeannette,
What I did was initially have the subform Not
Visible and with the after Update from the Combo Box placed it visible:

Me![qACCOUNTS SELECTION subform].Visible = True

but it does not work only when I go to design view and then back to form
view do the desired results appear in the second subform!!

Still think I might need some sort of refresh or open close command.

Thanks
Ange
 
J

Jeanette Cunningham

Ange,
there are 3 forms open, 2 as subforms.
Where is the combo with the after update code Me![qACCOUNTS SELECTION
subform].Visible = True? Is it on the main form or the 1st subform?
Is the qACCOUNTS SELECTION subform part of the 1st subform or is it just a
separate subform on the same main form?

Jeanette Cunningham

Ange Kappas said:
Hi Jeannette,
What I did was initially have the subform Not
Visible and with the after Update from the Combo Box placed it visible:

Me![qACCOUNTS SELECTION subform].Visible = True

but it does not work only when I go to design view and then back to form
view do the desired results appear in the second subform!!

Still think I might need some sort of refresh or open close command.

Thanks
Ange



Ange Kappas said:
Thanks Jeanette I understand the skeptic behind your proceedure, it woks,
just one more question if you don't mind, what code would I use so I can
incorporate it in my automations. By the way you have been a great help,
and my program is starting to work fine !!

Thanks
Ange
 
A

Ange Kappas

Hi Jeanette,
The Combo is on the Main Form.

The qACCOUNTS SELECTION is a separate subform on the main form.

Hope I have clarified.

Thanks
Ange


Jeanette Cunningham said:
Ange,
there are 3 forms open, 2 as subforms.
Where is the combo with the after update code Me![qACCOUNTS SELECTION
subform].Visible = True? Is it on the main form or the 1st subform?
Is the qACCOUNTS SELECTION subform part of the 1st subform or is it just a
separate subform on the same main form?

Jeanette Cunningham

Ange Kappas said:
Hi Jeannette,
What I did was initially have the subform Not
Visible and with the after Update from the Combo Box placed it visible:

Me![qACCOUNTS SELECTION subform].Visible = True

but it does not work only when I go to design view and then back to form
view do the desired results appear in the second subform!!

Still think I might need some sort of refresh or open close command.

Thanks
Ange



Ange Kappas said:
Thanks Jeanette I understand the skeptic behind your proceedure, it
woks,
just one more question if you don't mind, what code would I use so I can
incorporate it in my automations. By the way you have been a great help,
and my program is starting to work fine !!

Thanks
Ange


Instead of running an append query, save your selections in a query.
For an example I will call the query qAccountSelections.

The second subfom's data source will be qAccountSelections
Hide the second subform until you have finished making all the
selections, then make it visible.

The report's data source will also be qAccountSelections

Jeanette Cunningham

Hi,
This could be a tricky one.
What I've done is created a Form named ACCOUNTS SELECT which has a
control being a Comb Box named 'PICK RESNAME' and an embedded subform
which returns all the records according to the particular data from
the
'PICK RESNAME' Combo Box.
Thats all fine and well !
But what I need is to pick specific records and to store them in a
let's say temporary Table which I will print out via a Report. For
this
temporary table, I have created in the Form ACCOUNTS SELECT another
Subform which I hoped will view all the selections I have made
previously. In order for me to store the selections I have made a
Query
Append which runs everytime I make a selection with the Combo Box.

The problem is the Second Subform does not view the added on
selections
unless I exit and enter the Form again. Maybe I can use some sort of
Refresh code?

Thanks
Ange
 
J

Jeanette Cunningham

Ange,
I went back and looked over our other thread to remind me of how your form
is setup.
Main form has 3 combos, user makes their selection and the 1st subform shows
the records that match the selection.
Please tell me again why you need a second subform?
Is it showing a different set of records from the 1st subform?
If yes, explain to me the difference between the records shown in the 1st
subform and the ones you want to see in the 2nd subform.

Jeanette Cunningham

Ange Kappas said:
Hi Jeanette,
The Combo is on the Main Form.

The qACCOUNTS SELECTION is a separate subform on the main form.

Hope I have clarified.

Thanks
Ange


Jeanette Cunningham said:
Ange,
there are 3 forms open, 2 as subforms.
Where is the combo with the after update code Me![qACCOUNTS SELECTION
subform].Visible = True? Is it on the main form or the 1st subform?
Is the qACCOUNTS SELECTION subform part of the 1st subform or is it just
a
separate subform on the same main form?

Jeanette Cunningham

Ange Kappas said:
Hi Jeannette,
What I did was initially have the subform Not
Visible and with the after Update from the Combo Box placed it visible:

Me![qACCOUNTS SELECTION subform].Visible = True

but it does not work only when I go to design view and then back to form
view do the desired results appear in the second subform!!

Still think I might need some sort of refresh or open close command.

Thanks
Ange



Thanks Jeanette I understand the skeptic behind your proceedure, it
woks,
just one more question if you don't mind, what code would I use so I
can
incorporate it in my automations. By the way you have been a great
help,
and my program is starting to work fine !!

Thanks
Ange


Instead of running an append query, save your selections in a query.
For an example I will call the query qAccountSelections.

The second subfom's data source will be qAccountSelections
Hide the second subform until you have finished making all the
selections, then make it visible.

The report's data source will also be qAccountSelections

Jeanette Cunningham

Hi,
This could be a tricky one.
What I've done is created a Form named ACCOUNTS SELECT which has a
control being a Comb Box named 'PICK RESNAME' and an embedded subform
which returns all the records according to the particular data from
the
'PICK RESNAME' Combo Box.
Thats all fine and well !
But what I need is to pick specific records and to store them in a
let's say temporary Table which I will print out via a Report. For
this
temporary table, I have created in the Form ACCOUNTS SELECT another
Subform which I hoped will view all the selections I have made
previously. In order for me to store the selections I have made a
Query
Append which runs everytime I make a selection with the Combo Box.

The problem is the Second Subform does not view the added on
selections
unless I exit and enter the Form again. Maybe I can use some sort of
Refresh code?

Thanks
Ange
 
A

Ange Kappas

Hi Jeanette,
This is a new form similar to the one which had
three combos instead it has only one combo. The reason I'm using this form
is that the previous form selected a group of records based on the criteria
in the combo box. This new form selects particular records one by one.For
example if the previous form selected all the records satisfying the
criteria of COMPANY lets say with the initials "IMH" between the dates
3-5-07 and 10-5-07 it might return to me 10 records. Because there are
instances that the 10 records returned might have a different charge to them
I might only want to include only 4 records. The form which picks specific
records allows me to pick certain records I choose. That is why it is based
on the field RESNAME which means by reservation name, which there can only
be one record at a time.

Now the first subform picks the record I need and by running an Append Query
I copy that record to a table which temporarily stores the record. I then
select another record from the first subform and that again stores in that
table. That Table is my second subform which shows as I go along show all
the records I pick one at a time until I am ready to print it out the whole
lot of them. I may say here I have a code which every time I open the main
form the records in the temporary table are deleted so I can start again.

So all I want is to see in my second subform the records as I go along.

I hope I have cleared it up.

Thanks Jeanette
Ange


Jeanette Cunningham said:
Ange,
I went back and looked over our other thread to remind me of how your form
is setup.
Main form has 3 combos, user makes their selection and the 1st subform
shows the records that match the selection.
Please tell me again why you need a second subform?
Is it showing a different set of records from the 1st subform?
If yes, explain to me the difference between the records shown in the 1st
subform and the ones you want to see in the 2nd subform.

Jeanette Cunningham

Ange Kappas said:
Hi Jeanette,
The Combo is on the Main Form.

The qACCOUNTS SELECTION is a separate subform on the main form.

Hope I have clarified.

Thanks
Ange


Jeanette Cunningham said:
Ange,
there are 3 forms open, 2 as subforms.
Where is the combo with the after update code Me![qACCOUNTS SELECTION
subform].Visible = True? Is it on the main form or the 1st subform?
Is the qACCOUNTS SELECTION subform part of the 1st subform or is it just
a
separate subform on the same main form?

Jeanette Cunningham

Hi Jeannette,
What I did was initially have the subform Not
Visible and with the after Update from the Combo Box placed it visible:

Me![qACCOUNTS SELECTION subform].Visible = True

but it does not work only when I go to design view and then back to
form
view do the desired results appear in the second subform!!

Still think I might need some sort of refresh or open close command.

Thanks
Ange



Thanks Jeanette I understand the skeptic behind your proceedure, it
woks,
just one more question if you don't mind, what code would I use so I
can
incorporate it in my automations. By the way you have been a great
help,
and my program is starting to work fine !!

Thanks
Ange


Instead of running an append query, save your selections in a query.
For an example I will call the query qAccountSelections.

The second subfom's data source will be qAccountSelections
Hide the second subform until you have finished making all the
selections, then make it visible.

The report's data source will also be qAccountSelections

Jeanette Cunningham

Hi,
This could be a tricky one.
What I've done is created a Form named ACCOUNTS SELECT which has a
control being a Comb Box named 'PICK RESNAME' and an embedded
subform
which returns all the records according to the particular data from
the
'PICK RESNAME' Combo Box.
Thats all fine and well !
But what I need is to pick specific records and to store them in a
let's say temporary Table which I will print out via a Report. For
this
temporary table, I have created in the Form ACCOUNTS SELECT another
Subform which I hoped will view all the selections I have made
previously. In order for me to store the selections I have made a
Query
Append which runs everytime I make a selection with the Combo Box.

The problem is the Second Subform does not view the added on
selections
unless I exit and enter the Form again. Maybe I can use some sort of
Refresh code?

Thanks
Ange
 
J

Jeanette Cunningham

Ange,

Assuming the subform is bound to the temp table, each time you run the
append query to add a record to the temp table, you could do a requery of
the subform.
A requery will force the subform to go back to the temp table and get its
records.
If the code to run the append query runs from the main form, the code would
be something like

..........code to run the append query
Me.subformControlName.Requery

Jeanette Cunningham

Ange Kappas said:
Hi Jeanette,
This is a new form similar to the one which had
three combos instead it has only one combo. The reason I'm using this form
is that the previous form selected a group of records based on the
criteria in the combo box. This new form selects particular records one by
one.For example if the previous form selected all the records satisfying
the criteria of COMPANY lets say with the initials "IMH" between the dates
3-5-07 and 10-5-07 it might return to me 10 records. Because there are
instances that the 10 records returned might have a different charge to
them I might only want to include only 4 records. The form which picks
specific records allows me to pick certain records I choose. That is why
it is based on the field RESNAME which means by reservation name, which
there can only be one record at a time.

Now the first subform picks the record I need and by running an Append
Query I copy that record to a table which temporarily stores the record. I
then select another record from the first subform and that again stores in
that table. That Table is my second subform which shows as I go along show
all the records I pick one at a time until I am ready to print it out the
whole lot of them. I may say here I have a code which every time I open
the main form the records in the temporary table are deleted so I can
start again.

So all I want is to see in my second subform the records as I go along.

I hope I have cleared it up.

Thanks Jeanette
Ange


Jeanette Cunningham said:
Ange,
I went back and looked over our other thread to remind me of how your
form
is setup.
Main form has 3 combos, user makes their selection and the 1st subform
shows the records that match the selection.
Please tell me again why you need a second subform?
Is it showing a different set of records from the 1st subform?
If yes, explain to me the difference between the records shown in the 1st
subform and the ones you want to see in the 2nd subform.

Jeanette Cunningham

Ange Kappas said:
Hi Jeanette,
The Combo is on the Main Form.

The qACCOUNTS SELECTION is a separate subform on the main form.

Hope I have clarified.

Thanks
Ange


Ange,
there are 3 forms open, 2 as subforms.
Where is the combo with the after update code Me![qACCOUNTS SELECTION
subform].Visible = True? Is it on the main form or the 1st subform?
Is the qACCOUNTS SELECTION subform part of the 1st subform or is it
just
a
separate subform on the same main form?

Jeanette Cunningham

Hi Jeannette,
What I did was initially have the subform Not
Visible and with the after Update from the Combo Box placed it
visible:

Me![qACCOUNTS SELECTION subform].Visible = True

but it does not work only when I go to design view and then back to
form
view do the desired results appear in the second subform!!

Still think I might need some sort of refresh or open close command.

Thanks
Ange



Thanks Jeanette I understand the skeptic behind your proceedure, it
woks,
just one more question if you don't mind, what code would I use so I
can
incorporate it in my automations. By the way you have been a great
help,
and my program is starting to work fine !!

Thanks
Ange


message
Instead of running an append query, save your selections in a query.
For an example I will call the query qAccountSelections.

The second subfom's data source will be qAccountSelections
Hide the second subform until you have finished making all the
selections, then make it visible.

The report's data source will also be qAccountSelections

Jeanette Cunningham

Hi,
This could be a tricky one.
What I've done is created a Form named ACCOUNTS SELECT which has a
control being a Comb Box named 'PICK RESNAME' and an embedded
subform
which returns all the records according to the particular data from
the
'PICK RESNAME' Combo Box.
Thats all fine and well !
But what I need is to pick specific records and to store them in a
let's say temporary Table which I will print out via a Report. For
this
temporary table, I have created in the Form ACCOUNTS SELECT another
Subform which I hoped will view all the selections I have made
previously. In order for me to store the selections I have made a
Query
Append which runs everytime I make a selection with the Combo Box.

The problem is the Second Subform does not view the added on
selections
unless I exit and enter the Form again. Maybe I can use some sort
of
Refresh code?

Thanks
Ange
 
A

Ange Kappas

Again Thank You EVER SO MUCH Jeanette, it worked !!!!

Ange



Jeanette Cunningham said:
Ange,

Assuming the subform is bound to the temp table, each time you run the
append query to add a record to the temp table, you could do a requery of
the subform.
A requery will force the subform to go back to the temp table and get its
records.
If the code to run the append query runs from the main form, the code
would be something like

.........code to run the append query
Me.subformControlName.Requery

Jeanette Cunningham

Ange Kappas said:
Hi Jeanette,
This is a new form similar to the one which had
three combos instead it has only one combo. The reason I'm using this
form is that the previous form selected a group of records based on the
criteria in the combo box. This new form selects particular records one
by one.For example if the previous form selected all the records
satisfying the criteria of COMPANY lets say with the initials "IMH"
between the dates 3-5-07 and 10-5-07 it might return to me 10 records.
Because there are instances that the 10 records returned might have a
different charge to them I might only want to include only 4 records. The
form which picks specific records allows me to pick certain records I
choose. That is why it is based on the field RESNAME which means by
reservation name, which there can only be one record at a time.

Now the first subform picks the record I need and by running an Append
Query I copy that record to a table which temporarily stores the record.
I then select another record from the first subform and that again stores
in that table. That Table is my second subform which shows as I go along
show all the records I pick one at a time until I am ready to print it
out the whole lot of them. I may say here I have a code which every time
I open the main form the records in the temporary table are deleted so I
can start again.

So all I want is to see in my second subform the records as I go along.

I hope I have cleared it up.

Thanks Jeanette
Ange


Jeanette Cunningham said:
Ange,
I went back and looked over our other thread to remind me of how your
form
is setup.
Main form has 3 combos, user makes their selection and the 1st subform
shows the records that match the selection.
Please tell me again why you need a second subform?
Is it showing a different set of records from the 1st subform?
If yes, explain to me the difference between the records shown in the
1st subform and the ones you want to see in the 2nd subform.

Jeanette Cunningham

Hi Jeanette,
The Combo is on the Main Form.

The qACCOUNTS SELECTION is a separate subform on the main form.

Hope I have clarified.

Thanks
Ange


Ange,
there are 3 forms open, 2 as subforms.
Where is the combo with the after update code Me![qACCOUNTS SELECTION
subform].Visible = True? Is it on the main form or the 1st subform?
Is the qACCOUNTS SELECTION subform part of the 1st subform or is it
just
a
separate subform on the same main form?

Jeanette Cunningham

Hi Jeannette,
What I did was initially have the subform Not
Visible and with the after Update from the Combo Box placed it
visible:

Me![qACCOUNTS SELECTION subform].Visible = True

but it does not work only when I go to design view and then back to
form
view do the desired results appear in the second subform!!

Still think I might need some sort of refresh or open close command.

Thanks
Ange



Thanks Jeanette I understand the skeptic behind your proceedure, it
woks,
just one more question if you don't mind, what code would I use so I
can
incorporate it in my automations. By the way you have been a great
help,
and my program is starting to work fine !!

Thanks
Ange


message
Instead of running an append query, save your selections in a
query.
For an example I will call the query qAccountSelections.

The second subfom's data source will be qAccountSelections
Hide the second subform until you have finished making all the
selections, then make it visible.

The report's data source will also be qAccountSelections

Jeanette Cunningham

Hi,
This could be a tricky one.
What I've done is created a Form named ACCOUNTS SELECT which has a
control being a Comb Box named 'PICK RESNAME' and an embedded
subform
which returns all the records according to the particular data
from
the
'PICK RESNAME' Combo Box.
Thats all fine and well !
But what I need is to pick specific records and to store them in a
let's say temporary Table which I will print out via a Report. For
this
temporary table, I have created in the Form ACCOUNTS SELECT
another
Subform which I hoped will view all the selections I have made
previously. In order for me to store the selections I have made a
Query
Append which runs everytime I make a selection with the Combo Box.

The problem is the Second Subform does not view the added on
selections
unless I exit and enter the Form again. Maybe I can use some sort
of
Refresh code?

Thanks
Ange
 
C

Chris D

Change the property of the Data Entry on the 2nd subform to yes.

Apply a macro that populates the fields by some mouse selection.

Add a MS Access "canned" button that adds the new record. It's one of the
options when dropping a command button onto a form.

Every time you add the record here the table is updated instantly.
Any report you open for that table will have the current data.

Unless I do not understand your problem this is a quick fix.
 

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