condition macro - displaying the fieldname(s) from a query in MSGb

J

John

Hi,
I have a problem where i am using a condional macro where it will display a
message box alerting the user that there are 5 unpaid bookings.
Using:
DCount("[Student ID]","QRY Students that have not paid")>=5

which i think works.
But what isnt working is the message iin the message box where i am trying
to say "Title Forename Surname has 5 or more unpaid lessons"
I have tried to use:
=([Title] & " " & [Forename] & " " & [Surname],"QRY Students that have not
paid") & " has 5 or more unpaid lessons"
and
=[Title] & " " & [Forename] & " " & [Surname] & " has 5 or more unpaid
lessons"
But niether are working
Any help much appreciated
 
S

Steve Schapel

John,

What you are trying to do here is not possible. There is no way with
your present setup for Access to "know" which student(s) have 5 or more
unpaid lesons. I suppose if there was only 1 such student, you could
retrieve their name from the query using DLookup function. But what if
there are more than 1 student, whose name is supposed to go on the
MessageBox?
 
J

John

I was thinking of Name and Name and Name ...
but i understand now this cannot be done, thank you for clearing it up for me

Steve Schapel said:
John,

What you are trying to do here is not possible. There is no way with
your present setup for Access to "know" which student(s) have 5 or more
unpaid lesons. I suppose if there was only 1 such student, you could
retrieve their name from the query using DLookup function. But what if
there are more than 1 student, whose name is supposed to go on the
MessageBox?

--
Steve Schapel, Microsoft Access MVP

Hi,
I have a problem where i am using a condional macro where it will display a
message box alerting the user that there are 5 unpaid bookings.
Using:
DCount("[Student ID]","QRY Students that have not paid")>=5

which i think works.
But what isnt working is the message iin the message box where i am trying
to say "Title Forename Surname has 5 or more unpaid lessons"
I have tried to use:
=([Title] & " " & [Forename] & " " & [Surname],"QRY Students that have not
paid") & " has 5 or more unpaid lessons"
and
=[Title] & " " & [Forename] & " " & [Surname] & " has 5 or more unpaid
lessons"
But niether are working
Any help much appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top