Where to put Update Query....

S

Sandra Grawunder

I have a form for ticket sales based on a ticket sales
query (TktList) which selects only the unsold tickets
from the master ticket table. The master ticket table is
updated by a query which puts a check in the
Yes/No "Sold" field of the master ticket list based on
the ticket ID's sold in the form.

The TktList query is run automatically by the form, but I
don't know where or how to run the underlying update
query in the form to update the sold fields so that the
TktList query will be current and display the correct
unsold list of tickets in the form.

Is this clear as mud?? :-(

TIA,
Sandra
 
G

Guest

Woudn't you just use a do.cmd to run the query in the back end, then refresh
the form or query to show the new results?
(e-mail address removed)
 
S

Sandra Grawunder

Hmmm...
Seems I have another problem. If I delete a ticket sale,
I haven't figured out a way to update the ticket master
list and remove the checks from the Sold field so that
the tickets will be added back to the unsold ticket
list. Maybe I'm going about this the wrong way?
Thanks for any advise on this,
Sandra
 
J

John Vinson

Hmmm...
Seems I have another problem. If I delete a ticket sale,
I haven't figured out a way to update the ticket master
list and remove the checks from the Sold field so that
the tickets will be added back to the unsold ticket
list. Maybe I'm going about this the wrong way?

I'd say that you are. The status of a ticket - sold or unsold - can be
determined by looking in the Sales table. Having a checkbox in the
Ticket table is redundant (and you're suffering the universal problem
with redundant fields, i.e. that one member of the redundant data
storage pair disagrees with the other).
 
S

Sandra

I agree! So, how do I do this? I have a master ticket
list. I have a form for the ticket sale that gets the
patron from the Patron's list, and has a continuous
subform for the ticket detail table. In the subform is a
combo box to look up the ticket number from the ticket
list. I would like this combo box to only show tickets
available for sale i.e. not linked to a patron in the
ticket sale detail. Seems like a query that would filter
for tickets not in the ticket sales detail would work,
but I don't know how to construct the query.
Thanks for your help,
Sandra
 
S

Sandra

Lordy, do I feel like a dummy. I have never been much
past the select queries, and the Unmatched Query does the
trick. Like, DUH!!!
 
J

John Vinson

Lordy, do I feel like a dummy. I have never been much
past the select queries, and the Unmatched Query does the
trick. Like, DUH!!!

<g> Seeing the light dawn can be an exciting (and sometimes humbling)
experience, something that happens to me all the time.

It sounded from your posts that you were making the VERY common
mistake of focusing on Forms too early. Tables and good table design
are the basis; queries are the first - level tools; only then should
you start working on Forms and Reports.
 

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