Query results to MessageBox (1 Viewer)

RV

Registered User.
Local time
Today, 07:49
Joined
Feb 8, 2002
Messages
1,115
Hello,

I've got a database (Access97) with customers.
Of each customer the day of birth is registrated.
When starting up I'd like to pop up a screen with all customer names which are celebrating their birthday within a period of 30 days.

I've created a function to output the results of a query containing those birthdays to a string.I'm using a Do Until loop to scroll through the record results

I have two problems.
First, how can I get all query results in one loop.
So, if I've got two birthday I'd like the text in the popup screen to be like:

Birthdays : <carriage return>
Dan Janssen, 01/01/2002 <carriage return>
Dan Petersen, 01/10/2002

Second, how does one call a function?

TIA,

RV
 
R

Rich

Guest
Question has to be why make life difficult, why not use a list box based on an underlying SQL with the relevant criteria, open it on start up, if there are no records returned just use vba to close it, much more efficient than a loop.
 

RV

Registered User.
Local time
Today, 07:49
Joined
Feb 8, 2002
Messages
1,115
Rich,

thanks, I didn't even think of your suggestion!
Works great, I've transferred it to the life environment.

I'd like to get more familiar with functions in VBA.
Could you help me on my way by answering my first question?
More specific, I'd to know how to add each selected queryrow to one string.

TIA,

RV
 

Users who are viewing this thread

Top Bottom