Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter criteria in a query based on data within a form

Status
Not open for further replies.

8177

Programmer
Aug 6, 2003
25
GB
In MDB I would use [forms]![Form1]![ComboGroup] for example

I have looked at previous threads and tried to emulate them however still can’t get it to work

I have added to the input parameters on the data tab @group=[forms]![Form1]![ComboGroup]

And in the stored procedure I have added
ALTER PROCEDURE midasuser.qstpProjects
(@Combogroup nvarchar(50))
AS SELECT qselActiveABCProjects.Name AS MainProject, qselSubProjects.Name AS SubProject, midasuser.dbo_Groups.Name AS GroupName
FROM midasuser.qselActiveABCProjects() qselActiveABCProjects INNER JOIN
midasuser.dbo_Groups ON qselActiveABCProjects.GroupId = midasuser.dbo_Groups.Id LEFT OUTER JOIN
midasuser.qselSubProjects() qselSubProjects ON qselActiveABCProjects.Id = qselSubProjects.ParentId
WHERE (midasuser.dbo_Groups.Name = @Combogroup)

And I’m still getting a prompt to enter data can any body help a newbie to this tool
 
Try changing this to @combogroup to match the name in the SP.

I have added to the input parameters on the data tab @combogroup=[forms]![Form1]![ComboGroup]

Is Form1 open at the point this is being used?
 
Hi cmmrfrds

I noticed this faux par after i set the thread up and made the change and its still not working

I open the form select the value in the combo box
then run the sp and get a prompt to enter data

Thanks for your help

 
Are you sure this has a value?
=[forms]![Form1]![ComboGroup]

Before executing the SP put in a debug and print in the immediate window.

Debug.Print "group = "; [forms]![Form1]![ComboGroup]

Is this what you have in the recordsource?
midasuser.qstpProjects

Is midasuser the database owner?
 

Thanks i will try the debug once im in the office

Are you sure this has a value?
=[forms]![Form1]![ComboGroup]

This is a combobox in an unbound form and i select the value then open the SP

Is this what you have in the recordsource?
midasuser.qstpProjects

Yes

Is midasuser the database owner?

yes

When i run the SP and enter the data in the prompt the SP returns the correct set of records

Again many thanks for taking time to help a novice

 
Thanks for your help with this litle issue i had all is working now

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top