From: Sue on
Hi all

If a user chooses an Activity of 'Toil' on my form I want a pop-up form to
open displaying all available Toil Days for that user. The toil days are
created by a different routine which stores ItineraryID, ToilDate and
ToilTaken fields. I have a query (qry Toil Available) which joins the Toil
table with the Itinerary Table to find the Specialist for the activity and
only displays those records where ToilTaken is Null. If I run this query
with the form open on a record it works as desired. But if I try to use this
query in code to open the pop-up form it prompts the user to enter
Itinerary.Specialist. I've also added the criteria as a parameter to the
query in case this was the problem but it still doesn't work. Why does it
ask for this parameter when the query has it as criteria and works if opened
manually rather than via the code??? This is what I've tried... Thx. Sue

If Me![Activity] = "Toil" Then
If IsNull(Me![Specialist]) Then
msg = "Please enter a Specialist before choosing the Activity Toil."
MsgBox msg, vbCritical, "Specialist Required"
Else
DoCmd.OpenForm "frm Toil", , "qry Toil Available"
End If
End If