Can you be any more Vague.
Perhaps this example may help.
Sub CreateParamQuery()
Dim db As DAO.Database, rs As DAO.Recordset, QD As DAO.QueryDef
Dim EmpLastName As String, OrderDate As Date
Dim OrderID As Long, SQL As String
Dim ws As DAO.WorkSpace
Set ws = DBEngine(0)
Set db = ws.OpenDatabase("c:\Office97\Office\Samples\Northwind.MDB")
'Prompt for the employee's last name, OrderID, and Order Date
EmpLastName = InputBox("Enter the Employee's Last Name:")
OrderID = CLng(InputBox("Enter the OrderID:"))
OrderDate = CDate(InputBox("Enter the Order Date: "))
'Build the SQL statement with Parameters
SQL = "PARAMETERS [LName] Text, [OrdID] Long, [OrdDate] " _
& "Date;SELECT * FROM Employees INNER JOIN Orders ON " _
& "Employees.EmployeeID = Orders.EmployeeID WHERE " _
& "Employees.LastName = [LName] AND Orders.OrderID" _
& ">= [OrdID] AND Orders.OrderDate>=[OrdDate];"
'Create a temporary QueryDef object
Set QD = db.CreateQueryDef("", SQL)
'Set the parameter objects in the QueryDef
QD.Parameters!LName = EmpLastName
QD.Parameters!OrdID = OrderID
QD.Parameters!OrdDate = OrderDate
'Open the RecordSet
Set rs = QD.OpenRecordSet()
Debug.Print "LastName OrderID OrderDate"
Debug.Print "================================"
Do Until rs.EOF
Debug.Print rs!LastName & " " & rs!OrderID & " " & _
rs!OrderDate
rs.MoveNext
Loop
rs.Close
db.Close
End Sub