requery from form

S

Sal

am using Access 2007 - but the database I working with was sent to me in 2000
access.

I have a table of invitees to an event. I built a query based on the "last
name" field.
I made a form based on that query. When I enter a new invitee using the
form it doesn't requery, I have to go back to the query and requery.

How can I requery when I enter a new invitee?

appreciate any help
 
K

Ken Snell [MVP]

If you enter a new record via the form, then the form *must* show you the
record that you're entering, else you couldn't use the form to enter the
data.

By chance, are you asking how to have another form (already open) be
requeried in order to show the newly entered value that you entered on a
different form? If yes, you can requery the first form from the second form,
using the second form's Close event.

Or are you asking about a combobox that is displaying data from the table
and you've added a new entry on a different form? And you need to requery
the combobox? Again, you can do that from the second form's Close event.
 
S

Sal

I am entering a new invitee on a simple form (name, title, etc.) that is
based on a query in the form the new invitee shows. I can close this form,
go to the query, requery it and then reopen the form its conforms with the
requery ... am trying to find a quicker / "automatic" way to avoid what I'm
doing now
 
K

Ken Snell [MVP]

Running a query on its own does *nothing* for allowing a form to show data
from the query, so you're not actually accomplishing anything by that step.
Instead, closing the form and reopening it causes the form to rerun its
underlying query -- that actually is what's working for you.

However, I think there is more info to be told to us about your form. What
is the SQL statement of the form's RecordSource query (the query that you're
"running")? What is the value of the Data Entry property for the form?

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 
S

Sal

Ken,

thanks yours. The query is simlpy "asscending" sort of the last name.

I used to use Access a lot many years ago and I had a number of forms that
when entering a new record, the query would be rerun while I was still using
the form. Am trying to find those access mdb's but afraid they're stuck on a
cd in box at home when I moved.

hope what I'm trying to do is clearer?!

regards
Sal
 
K

Ken Snell [MVP]

You're not providing us with enough to help you debug this situation. I
asked for you to post the SQL statement, and to identify the value of the
Data Entry property for the form. Again, something about your form's setup
and/or use is causing the result that you're seeing, but we cannot see your
database and thus need you to tell us the details, please.
 
S

Sal

thanks your reply
you have me lost -- I have a table contains names, address, comm. details of
people we invite to various conferences. I use the query by design - I put
all the fields in the query and under the Last Name Field I put "ascending"
for sort options.
I use no SQL but QBE.
What do you mean by Data Entry property for the form? As the data source
for the forum it is the query I just described.

Please try to bring me upto speed in laymans terms.

thanks again

Sal
 
J

John W. Vinson

thanks your reply
you have me lost -- I have a table contains names, address, comm. details of
people we invite to various conferences. I use the query by design - I put
all the fields in the query and under the Last Name Field I put "ascending"
for sort options.
I use no SQL but QBE.
What do you mean by Data Entry property for the form? As the data source
for the forum it is the query I just described.

Please try to bring me upto speed in laymans terms.

The QBE grid is not the query. The SQL is the *real* query; QBE is just a tool
to build SQL. You can open the query in design view, and select View... SQL
from the menu, and copy and paste it to a message here. It may look like the
Mayan Codex right now, but most of the regulars here can read it easily.

If you view the Form's Properties, one of them is named "Data Entry". If that
property is set to Yes then the form will allow new records to be entered but
will not display existing records. This is a separate property from the
Recordsource.
 
S

Sal

John and Ken -- thanks for the patience -- at my work, almost all are anti
Access - then put all there data in an Excel spreadsheet until it no longer
will manage the data they way they wish -- so there not much support around
here!

to answer your questions
the SQL statement for the query is:
SELECT [Freight Summit Sept 15-16 09].Company, [Freight Summit Sept 15-16
09].[Full Name], [Freight Summit Sept 15-16 09].Title, [Freight Summit Sept
15-16 09].[First Name], [Freight Summit Sept 15-16 09].[Middle Name],
[Freight Summit Sept 15-16 09].[Last Name], [Freight Summit Sept 15-16
09].Suffix, [Freight Summit Sept 15-16 09].Nickname, [Freight Summit Sept
15-16 09].[Job Title], [Freight Summit Sept 15-16 09].Address, [Freight
Summit Sept 15-16 09].City, [Freight Summit Sept 15-16 09].State, [Freight
Summit Sept 15-16 09].Zip, [Freight Summit Sept 15-16 09].Phone, [Freight
Summit Sept 15-16 09].Fax, [Freight Summit Sept 15-16 09].[E-Mail], [Freight
Summit Sept 15-16 09].[Attended 08 Freight Symposium], [Freight Summit Sept
15-16 09].[Attended 09 Critical Commodity], [Freight Summit Sept 15-16
09].[Invited to Sept 15-16 09 Freight Summit], [Freight Summit Sept 15-16
09].STD, [Freight Summit Sept 15-16 09].[Not Attending], [Freight Summit Sept
15-16 09].[Registered Attendee to Summit], [Freight Summit Sept 15-16
09].[Attend Sept 15 09 luncheon], [Freight Summit Sept 15-16 09].[Attend Sept
15 09 reception], [Freight Summit Sept 15-16 09].[Attend Sept 16 09 breakfast]
FROM [Freight Summit Sept 15-16 09]
ORDER BY [Freight Summit Sept 15-16 09].[Last Name];

Data rnyty for my form is "NO"

I know I'm missing something simple .... something I did years ago ...

appreciate your patience and help
 
J

John W. Vinson

John and Ken -- thanks for the patience -- at my work, almost all are anti
Access - then put all there data in an Excel spreadsheet until it no longer
will manage the data they way they wish -- so there not much support around
here!

to answer your questions
the SQL statement for the query is:
SELECT [Freight Summit Sept 15-16 09].Company, [Freight Summit Sept 15-16
09].[Full Name], [Freight Summit Sept 15-16 09].Title, [Freight Summit Sept
15-16 09].[First Name], [Freight Summit Sept 15-16 09].[Middle Name],
[Freight Summit Sept 15-16 09].[Last Name], [Freight Summit Sept 15-16
09].Suffix, [Freight Summit Sept 15-16 09].Nickname, [Freight Summit Sept
15-16 09].[Job Title], [Freight Summit Sept 15-16 09].Address, [Freight
Summit Sept 15-16 09].City, [Freight Summit Sept 15-16 09].State, [Freight
Summit Sept 15-16 09].Zip, [Freight Summit Sept 15-16 09].Phone, [Freight
Summit Sept 15-16 09].Fax, [Freight Summit Sept 15-16 09].[E-Mail], [Freight
Summit Sept 15-16 09].[Attended 08 Freight Symposium], [Freight Summit Sept
15-16 09].[Attended 09 Critical Commodity], [Freight Summit Sept 15-16
09].[Invited to Sept 15-16 09 Freight Summit], [Freight Summit Sept 15-16
09].STD, [Freight Summit Sept 15-16 09].[Not Attending], [Freight Summit Sept
15-16 09].[Registered Attendee to Summit], [Freight Summit Sept 15-16
09].[Attend Sept 15 09 luncheon], [Freight Summit Sept 15-16 09].[Attend Sept
15 09 reception], [Freight Summit Sept 15-16 09].[Attend Sept 16 09 breakfast]
FROM [Freight Summit Sept 15-16 09]
ORDER BY [Freight Summit Sept 15-16 09].[Last Name];

Data rnyty for my form is "NO"

I know I'm missing something simple .... something I did years ago ...

Your original message referred to "rerunning" a query. A Select query like
this doesn't need to get "run" - it's just THERE, it provides a recordset of
records sorted by last name.

What is it doing that you don't want, or not doing that you do want?
 
S

Sal

John,

thanks again your reply

When I use the form to enter new records and then go back to click throuhg
the records in the form the new entries are at the last of the records - i.e.
they have not been sorted by ascending order by last name. I was told that
I'd have to close the form and run the query again before I same the records
in form sorted by last name in ascending order.
I remember having this problem years ago and found a way to have query run
after entrance of each new record.

hope that was clear! its been a brutal week at work and at home (wife
sick)!!!

thanks again - await yours

John W. Vinson said:
John and Ken -- thanks for the patience -- at my work, almost all are anti
Access - then put all there data in an Excel spreadsheet until it no longer
will manage the data they way they wish -- so there not much support around
here!

to answer your questions
the SQL statement for the query is:
SELECT [Freight Summit Sept 15-16 09].Company, [Freight Summit Sept 15-16
09].[Full Name], [Freight Summit Sept 15-16 09].Title, [Freight Summit Sept
15-16 09].[First Name], [Freight Summit Sept 15-16 09].[Middle Name],
[Freight Summit Sept 15-16 09].[Last Name], [Freight Summit Sept 15-16
09].Suffix, [Freight Summit Sept 15-16 09].Nickname, [Freight Summit Sept
15-16 09].[Job Title], [Freight Summit Sept 15-16 09].Address, [Freight
Summit Sept 15-16 09].City, [Freight Summit Sept 15-16 09].State, [Freight
Summit Sept 15-16 09].Zip, [Freight Summit Sept 15-16 09].Phone, [Freight
Summit Sept 15-16 09].Fax, [Freight Summit Sept 15-16 09].[E-Mail], [Freight
Summit Sept 15-16 09].[Attended 08 Freight Symposium], [Freight Summit Sept
15-16 09].[Attended 09 Critical Commodity], [Freight Summit Sept 15-16
09].[Invited to Sept 15-16 09 Freight Summit], [Freight Summit Sept 15-16
09].STD, [Freight Summit Sept 15-16 09].[Not Attending], [Freight Summit Sept
15-16 09].[Registered Attendee to Summit], [Freight Summit Sept 15-16
09].[Attend Sept 15 09 luncheon], [Freight Summit Sept 15-16 09].[Attend Sept
15 09 reception], [Freight Summit Sept 15-16 09].[Attend Sept 16 09 breakfast]
FROM [Freight Summit Sept 15-16 09]
ORDER BY [Freight Summit Sept 15-16 09].[Last Name];

Data rnyty for my form is "NO"

I know I'm missing something simple .... something I did years ago ...

Your original message referred to "rerunning" a query. A Select query like
this doesn't need to get "run" - it's just THERE, it provides a recordset of
records sorted by last name.

What is it doing that you don't want, or not doing that you do want?
 
J

John W. Vinson

When I use the form to enter new records and then go back to click throuhg
the records in the form the new entries are at the last of the records - i.e.
they have not been sorted by ascending order by last name. I was told that
I'd have to close the form and run the query again before I same the records
in form sorted by last name in ascending order.

Ah. Sorry, I missed that!

You can Requery the form to accomplish the same end. For instance you could
put VBA code or a Macro in the form's Afterupdate event to requery it.

This will be rather disconcerting for the user since the record they entered
will vanish and it will jump to the first record. You might want instead to
put a command button on the form to do the requery on demand rather than
having it requery unexpectedly.
 
S

Sal

John,

Thanks yours. Was unable to review my late '90's access work - a hectic
weekend - but I am very sure the command button to requery on demand is what
I used! Know to remember how I did it ....

Your support has been very much appreciated.
Regards
Sal
 

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