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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?
 
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
 
Back
Top