Hi,
I need to use DAO (which I haven't used for years as all recent apps have been in SQL server or adp files) and can't remeber the syntax for creating a DAO recordset from a paramater query based upon 2 combo box string values on a form. I am absolutely fine with ADO but in this case I need to pass a DAO recordset to another application.
The Query SQL is detailed below and both filter fields are Text fields
SELECT ULD_TAG.*, ULD_TAG.TMP_ASSET, ULD_TAG.TMP_SYS
FROM ULD_TAG
WHERE (((ULD_TAG.TMP_ASSET) Like "*" And (ULD_TAG.TMP_ASSET)=[Forms]![frm_asset_filt]![cbo_asset]) AND ((ULD_TAG.TMP_SYS) Like "*" And (ULD_TAG.TMP_SYS)=[Forms]![frm_asset_filt]![cbo_sys]));
The code I am using gives an error value of too few parameters expected
Const strTable = "QRY_TRV"
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(strTable, dbOpenDynaset, dbReadOnly)
Thanks for your help
Regards
Jon
I need to use DAO (which I haven't used for years as all recent apps have been in SQL server or adp files) and can't remeber the syntax for creating a DAO recordset from a paramater query based upon 2 combo box string values on a form. I am absolutely fine with ADO but in this case I need to pass a DAO recordset to another application.
The Query SQL is detailed below and both filter fields are Text fields
SELECT ULD_TAG.*, ULD_TAG.TMP_ASSET, ULD_TAG.TMP_SYS
FROM ULD_TAG
WHERE (((ULD_TAG.TMP_ASSET) Like "*" And (ULD_TAG.TMP_ASSET)=[Forms]![frm_asset_filt]![cbo_asset]) AND ((ULD_TAG.TMP_SYS) Like "*" And (ULD_TAG.TMP_SYS)=[Forms]![frm_asset_filt]![cbo_sys]));
The code I am using gives an error value of too few parameters expected
Const strTable = "QRY_TRV"
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(strTable, dbOpenDynaset, dbReadOnly)
Thanks for your help
Regards
Jon
Last edited: