Re: Selection from multi select list box....
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Wed, 4 Apr 2007 08:36:17 +0800
That's right: if the form is unbound, you can skip the part that check if it is dirty, since an unbound form can't be dirty.
You can still use the approach of creating the Mailing record, and then storing the customers in the mailing.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"debraj007" <debraj007@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F3A3A8BB-7173-48A7-931C-8E79E20A96FA@xxxxxxxxxxxxxxxx
Thanks. I tried the add and execute code (modified of course with my field
names, tables, etc.) and it didn't work. So I came up with a couple of
different reasons that may have happened:
1. The ever present, maybe I screwed something up
2. The form I'm using to select customers is a pop up (not a subform) with a
listbox and a command button, so I can't really use me.dirty can I, because
I'm not really making changes and there is no record to copy from this
form.... right?
Deb
"Allen Browne" wrote:
To do that you need to store that info.
2 tables:
a) Mailing table, with fields:
MailingID AutoNumber primary key
MailingDate Date/Time when you sent this
QuoteID Number relates to Quote.QuoteID
Descrip Text optional description of mailing
b) MailingDetail table, with fields:
MailingID Number relates to Mailing.MailingID
CustomerID Number relates to Customer.CustomerID
Now, the query you created last time: turn it into an Append query (Append
on Query menu, in query design.) Access asks which table to append to:
answer MailingDetail. Type this into a fresh column in the Field row:
MailingID: 99
and indicate this goes to the MailingID column.
Switch the query to SQL View (View menu.)
There's an example of the SQL statement you need to execute.
Now you will write some code to OpenRecordset on the Mailing Table, AddNew
and Update, and get the new MailingID number. You will then create a SQL
string to Execute, adding the new MailingID number into the string in place
of the 99.
If the Execute idea is new, here's an example:
http://allenbrowne.com/ser-60.html
or here's another that uses AddNew and then Execute:
http://allenbrowne.com/ser-57.html
"debraj007" <debraj007@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:55ADF9ED-974A-4197-BB53-29B97004135F@xxxxxxxxxxxxxxxx
> Thank you Allen, as usual, the perfect solution :-). One more question. > is
> there a way to track which customers I sent the quote to (which people > I
> selected from the list box) so I can pull reports later on if needed?
>
> Deb
>
> "Allen Browne" wrote:
>
>> One approach would be to create a query that uses both tables (the >> people
>> you send to, and the quotes), but without any line joining them in the
>> upper
>> pane of query design. This gives you every possible combination of the >> 2.
>>
>> Create a report based on this query, laid out with the person's names >> at
>> the
>> top, and the quote underneath. Use the Sorting And Grouping dialog to
>> create
>> a group header on each QuoteID, and set the properties of the QuoteID
>> header
>> so each quote starts on a new page.
>>
>> Create a form where the user selects the quote number, chooses the >> people
>> in
>> the multi-select list box, and clicks a button to print them. The >> Click
>> event procedure of the command button uses OpenReport with a
>> WhereCondition
>> so that it prints the right quote for the right people.
>>
>> For an example of how to build the WhereCondition string, see:
>> Use a multi-select list box to filter a report
>> at:
>> http://allenbrowne.com/ser-50.html
>> You will also need to add to the end of that string so it prints just >> the
>> one quote. Something like this:
>> strWhere = strWhere & " AND (QuoteID = " & Me.[QuoteID]
>>
>> "debraj007" <debraj007@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:4FEA43E1-C8D6-4ACE-A115-FE4B0F297F7E@xxxxxxxxxxxxxxxx
>> > Hi, and thanks for any help you can offer, I'm stumped. I'm working >> > on
>> > a
>> > quotation database. I need the ability to enter a quote and send it >> > to
>> > several people. I have the quote form established.
>> >
>> > After entering the quote you click a button and a pop up form comes >> > up.
>> > On
>> > the pop up, you choose which customers to send the quote to (multi
>> > select
>> > list box) and click another button to preview or print the actual
>> > quote.
>> >
>> > Here's where I'm stumped. I can't figure out how to customize the >> > quote
>> > for
>> > the people I chose from the list box (i.e. I would like their names,
>> > addresses, etc. to be on the printed quote, 1 quote per page >> > please).
>> > Any
>> > suggestions from ye old wise ones?
.
- References:
- Re: Selection from multi select list box....
- From: Allen Browne
- Re: Selection from multi select list box....
- From: Allen Browne
- Re: Selection from multi select list box....
- From: debraj007
- Re: Selection from multi select list box....
- Prev by Date: Re: Viewing Access Reports on Web page prompts download
- Next by Date: Re: Flexible default y-axis labels in Microsoft Graph
- Previous by thread: Re: Selection from multi select list box....
- Next by thread: Re: Page breaks
- Index(es):
Relevant Pages
|