SundancerKid
Programmer
When running reports in ADP and you are passing parameters you will be using Stored Procedures.
Reference to passing parameters will be referenced in the Input Parameters field under the Report properties.
Reference to passing parameters for forms you will be using VBA for Forms.
Report::::
Example of a Stored Procedure that I created
Alter PROCEDURE [Booth Procedure]
@Select_Show int
As
SELECT shows.s_name, contracts.con_booth_assigned,
contracts.con_booth_sqft, exhibitors.e_name, shows.s_facility, convert( int, rtrim(contracts.con_booth_assigned)) as BOOTH
FROM contracts INNER JOIN
exhibitors ON contracts.e_id = exhibitors.e_id INNER JOIN
shows ON contracts.s_id = shows.s_id
WHERE dbo.contracts.s_id = @Select_Show
Report (Main) Properties
Input Parameters @Select_Show = Forms![frm_SelectShowDialog]![SelectShow]
Form using a List Box
VBA Code:
Private Sub Last_Click()
' --- This resets the query for the last names ----
Dim FoundLastName As String
FoundLastName = Forms![frm_record_find].FindLastName
FoundLastName = "%" + FoundLastName + "%"
Me.List19.RowSource = "Exec FindLastName @LName = ' " &
FoundLastName & " ' "
Me.Repaint ' Save data for query
Me.Refresh ' Requery drop down listing
End Sub
Stored Procedure used:
Alter Procedure FindLastName
@LName as varchar(30)
As
SELECT DISTINCT
buyers.store_id as StoreID, buyers.buy_lname as Last,
buyers.buy_fname as First, stores.store_name as Store
FROM buyers INNER JOIN
stores ON buyers.store_id = stores.store_id
WHERE (buyers.buy_lname LIKE @LName)
ORDER BY buyers.buy_lname
return
I hope some of this help everyone.
Thanks to everyone that helped me.
Reference to passing parameters will be referenced in the Input Parameters field under the Report properties.
Reference to passing parameters for forms you will be using VBA for Forms.
Report::::
Example of a Stored Procedure that I created
Alter PROCEDURE [Booth Procedure]
@Select_Show int
As
SELECT shows.s_name, contracts.con_booth_assigned,
contracts.con_booth_sqft, exhibitors.e_name, shows.s_facility, convert( int, rtrim(contracts.con_booth_assigned)) as BOOTH
FROM contracts INNER JOIN
exhibitors ON contracts.e_id = exhibitors.e_id INNER JOIN
shows ON contracts.s_id = shows.s_id
WHERE dbo.contracts.s_id = @Select_Show
Report (Main) Properties
Input Parameters @Select_Show = Forms![frm_SelectShowDialog]![SelectShow]
Form using a List Box
VBA Code:
Private Sub Last_Click()
' --- This resets the query for the last names ----
Dim FoundLastName As String
FoundLastName = Forms![frm_record_find].FindLastName
FoundLastName = "%" + FoundLastName + "%"
Me.List19.RowSource = "Exec FindLastName @LName = ' " &
FoundLastName & " ' "
Me.Repaint ' Save data for query
Me.Refresh ' Requery drop down listing
End Sub
Stored Procedure used:
Alter Procedure FindLastName
@LName as varchar(30)
As
SELECT DISTINCT
buyers.store_id as StoreID, buyers.buy_lname as Last,
buyers.buy_fname as First, stores.store_name as Store
FROM buyers INNER JOIN
stores ON buyers.store_id = stores.store_id
WHERE (buyers.buy_lname LIKE @LName)
ORDER BY buyers.buy_lname
return
I hope some of this help everyone.
Thanks to everyone that helped me.