A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

openform filter



 
 
Thread Tools Display Modes
  #1  
Old March 18th, 2010, 04:53 PM posted to microsoft.public.access
Sue[_9_]
external usenet poster
 
Posts: 65
Default openform filter

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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.