Photowrap
07-28-2010, 04:48 AM
Hi
Certain postcodes cost more to deliver to.
My invoices are access reports generated from a query. If the post code is an expensive one, how can I alter the invoice query to get a message box rather than the report being created?
vbaInet
07-28-2010, 05:03 AM
Create a query and filter out all the ones you don't want printed by setting criteria in the query. Use that query as your report's Record Source.
Welcome to the forum.
Photowrap
08-01-2010, 05:37 AM
In the query (for the Report) I created the Field below, which works; but with the expression builder I put the Criteria as shown, which doesn't work (get error message) - What have I done wrong?
Field:
Ship?: IIf([Carrier]="UPS" And [Post Code]="IV30","UPS","DHL")
Criteria:
MsgBox"Change Carrier to DHL"vbInformation,"Expensive Shipping"
vbaInet
08-01-2010, 05:46 AM
Ship: IIF([Carrier]="UPS" AND ([Postcode]="IV30" OR [Postcode]="UPS"...))
What was the question mark for?
Photowrap
08-01-2010, 11:15 PM
The question mark is just for my benefit. But the code I had for that query does work.
The important thing is that I want a message box to appear for certain Post Codes warning me that shipping will be expensive. Any clues?
vbaInet
08-01-2010, 11:29 PM
As mentioned earlier, filter out the ones you don't want printed and base your report on that. You can get a message box to prompt you but you will not be able to stop it from printing.
You can then create another report to display all the filtered values.
Photowrap
08-02-2010, 12:13 AM
Could I assume that you don't know how to create a message box?
vbaInet
08-02-2010, 10:19 AM
Your assumption would be precise in that case.