M
Mota
Hello;
When i open a form that is bound to a parameter query ,"Please enter
parameter" dialog box appears,even if i set its parameter before.The SQL
string of query and its opening code is:
PARAMETERS [DrugID] Integer;
Select * from DrugsTBL where Did=[DrugID];
Private Sub CmdOpenForm_Click
dim DB as DataBase,QDF as QueryDef
Set DB=DBEngine(0)(0)
set QDF=DB.QueryDefs!OpenQRY
QDF.Parameters(0)=7
DoCmd.OpenForm "FrmBoundToOpenQuery"
End Sub
In MVP.Org/Access Web Dev Ashish expresses this way to use a parameter query
for a recordSource of a DAO.RecordSet,but it really wont work for a form
RecordSource.
Where am i going wrong?Is there another way to do this,other than setting
SQL of that query each time we want to open form?
Thank you so much for your help.
When i open a form that is bound to a parameter query ,"Please enter
parameter" dialog box appears,even if i set its parameter before.The SQL
string of query and its opening code is:
PARAMETERS [DrugID] Integer;
Select * from DrugsTBL where Did=[DrugID];
Private Sub CmdOpenForm_Click
dim DB as DataBase,QDF as QueryDef
Set DB=DBEngine(0)(0)
set QDF=DB.QueryDefs!OpenQRY
QDF.Parameters(0)=7
DoCmd.OpenForm "FrmBoundToOpenQuery"
End Sub
In MVP.Org/Access Web Dev Ashish expresses this way to use a parameter query
for a recordSource of a DAO.RecordSet,but it really wont work for a form
RecordSource.
Where am i going wrong?Is there another way to do this,other than setting
SQL of that query each time we want to open form?
Thank you so much for your help.