Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Shimon Shimon is offline
external usenet poster
 
Posts: 5
Default Is it possible to use a query that is based on a function in a mail merge?

I have a word docment that imports data from access. When the query is bases
on a number it wrks fine, but when I use a function in the query, word
responds with an error and cannot open the data source.

SELECT qselItem_List.*, qselItem_List.ReadyForTranslating
FROM qselItem_List
WHERE ( ((qselItem_List.SaleID) CurrentAuctionNumber()))
ORDER BY qselItem_List.AutoNumber;

Here is the function that the query uses.


Public Const stCurrentAuctionNumber = 45
Public Static Function CurrentAuctionNumber() As Double
Static currAuctionNumber As Double
If tempCurrAuctionNumber = 0 Then
CurrentAuctionNumber = stCurrentAuctionNumber
tempCurrAuctionNumber = stCurrentAuctionNumber
Else: CurrentAuctionNumber = tempCurrAuctionNumber
End If
End Function

I would like to use this function, so that I can change the criteria from
tim to time by using the setCurrentAuctionNumber

Public Static Function SetTempAuctionNumber(dAuctionNumber)
tempCurrAuctionNumber = dAuctionNumber
End Function

Thanks for any help,
Shmon



 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Mail-merge to email looses BG Color on Web-Based Mail Micmojav Mailmerge 4 September 18th 07 05:34 PM
Mail Merge and MS Query Roger0x1 Microsoft Word Help 1 April 11th 07 04:53 PM
Mail Merge Query minignaz Mailmerge 2 August 1st 06 08:56 AM
mail merge query jimmy Mailmerge 1 May 17th 05 12:28 PM
how do I set up a query for my mail merge Laura Mailmerge 1 March 22nd 05 09:31 PM


All times are GMT +1. The time now is 03:50 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"