Hello,
I am trying to enable some fields on my form if some criteria in my query is valid. However I am getting error 3061 too few parameters: expected 2.
for simple explanation, I put two fields abc & xyz on my form, and onloading form I am calling sub to enabled these fields if they match my query. Below is my code.
Thanks in Advance
Private Sub Form_Load()
Dim cn As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("MyQry")...Here is the error
rs.MoveFirst
Do Until rs.EOF
Select Case rs!QryField
Case abc
Me.abc.Enabled = True
Case xyz
Me.xyz.Enabled = True
End Select
Loop
End Sub
Note: I have a field in MyQry called QryField & it retrieves abc & xyz & other data which match the fields' names on my form. Moreover; MyQry is not bound to this form.
Please Advice.
I am trying to enable some fields on my form if some criteria in my query is valid. However I am getting error 3061 too few parameters: expected 2.
for simple explanation, I put two fields abc & xyz on my form, and onloading form I am calling sub to enabled these fields if they match my query. Below is my code.
Thanks in Advance
Private Sub Form_Load()
Dim cn As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("MyQry")...Here is the error
rs.MoveFirst
Do Until rs.EOF
Select Case rs!QryField
Case abc
Me.abc.Enabled = True
Case xyz
Me.xyz.Enabled = True
End Select
Loop
End Sub
Note: I have a field in MyQry called QryField & it retrieves abc & xyz & other data which match the fields' names on my form. Moreover; MyQry is not bound to this form.
Please Advice.