C
Craig
I have a database of 12000 names and want to send out a letter to a random
selection of 300. I am using the following function and query:
Top Values property of a query, with a Module:
Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function
Then add a calculated field to your Query by typing
Shuffle: RndNum([fieldname])
Top Value = 300
**************
I now want to use the query to mail merge into a Word Document, but I cannot
get it to work.
I get an a message "Record 1 contained too few data fields". None of the
fields in the query apprear in the data list and all I get is two fields
named "M__" and "M__1" with no data.
I have tried this with two different random select queries, which give me
random query results but still not able to use the query to mail merge.
Any suggestions ?
Craig
selection of 300. I am using the following function and query:
Top Values property of a query, with a Module:
Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function
Then add a calculated field to your Query by typing
Shuffle: RndNum([fieldname])
Top Value = 300
**************
I now want to use the query to mail merge into a Word Document, but I cannot
get it to work.
I get an a message "Record 1 contained too few data fields". None of the
fields in the query apprear in the data list and all I get is two fields
named "M__" and "M__1" with no data.
I have tried this with two different random select queries, which give me
random query results but still not able to use the query to mail merge.
Any suggestions ?
Craig