if your query works when you specify a value then perhaps something wrong with your selection?
see this
WHERE (((tblProvider.ID)=[forms]
why not put value of [forms]![form1]![cboprovid
then you can debug that value
e.g
dim x
x=[forms]![form1]




by: mgrattanPosted on 2005-12-06 at 13:03:36ID: 15431279
You need to pass the parameters of the query directly to the parameter property. Here's an example of a function that works in a DAO query:
OpenDynase t)
Public Function LoadQuery(ByRef rqdfQuery As QueryDef) As DAO.Recordset
Dim dbDatabase As DAO.Database
Dim prmParameter As Parameter
On Error GoTo LoadQuery_EH
Set dbDatabase = CurrentDb
For Each prmParameter In rqdfQuery.Parameters
prmParameter.Value = Eval(prmParameter.Name)
Next prmParameter
Set LoadQuery = rqdfQuery.OpenRecordset(db
LoadQuery_Exit:
Exit Function
LoadQuery_EH:
MsgBox Err.Description & ". Unable to run the " & rqdfQuery.Name & " query."
Resume LoadQuery_Exit
End Function