K
Ken Snell \(MVP\)
The Help files contain some information on this. Search on Form Object and
select Recordset from the Properties list.
select Recordset from the Properties list.
The Recordset property of a form was introduced
in Access 2000 and is settable to a predefined DAO recordset
(never an ADO recordset, as form recordsets are always DAO).
As I mentioned in my previuos post, the reason why I don't use an
sql statement is because I need to join data from a local table
and a remote table. the remote table is not a linked table, for
each row in the list box I regenerate the connection string.
I know how to work with recordsets and thinking about it, I don't
see any utility in populating a form from a variable unless it is
coming from another database.
Set Form_frmDoobloFileDetails.Recordset = rsNew
Form_frmDoobloFileDetails.txtDoobloCode.ControlSource =
"SbjNum"
Form_frmDoobloFileDetails.txtDate.ControlSource = "vDate"
Form_frmDoobloFileDetails.txtSurviyer.ControlSource = "Srvyr"
Form_frmDoobloFileDetails.txtBranch.ControlSource = "SbjNam"
Form_frmDoobloFileDetails.chkRecordImported.ControlSource =
"IsImported"
Danny said:Seems like
the .Recordset property of reports was not as simple or flexible, but
I forget the details of the issues I faced.
David said:As I said in another post, this is incorrect. The form's Recordset
property can be set to an ADO recordset, but it will be read-only.
No, you can very well have updateable forms that are based on ADO
recordsets, except as I stated elsewhere
if you're using Access 2000 AND it's based on Jet data
David said:That's not what MichKa's article says. Did it change after he posted
that? And is this specific to A2K?
I can't speak for ALL situations, but with an Access 2003 ADP
one can load a form with an ADO recordset that is updateable.
Your post was very helpfull, I'm opening the recordset with the
following sql string:
SELECT ([export1].[SbjNum]) In (select doobloid from " &
sTableName & ") AS IsImported, * FROM export1 IN '" & sFilePath &
"\" & sFileName & "'"
It works great!
David W. Fenton said:Your post was very helpfull, I'm opening the recordset with the
following sql string:
SELECT ([export1].[SbjNum]) In (select doobloid from " &
sTableName & ") AS IsImported, * FROM export1 IN '" & sFilePath &
"\" & sFileName & "'"
It works great!
Much easier, no? I'm so glad you worked it out (as it can be kinda
complicated to get the connect strings and the derived table syntax
correct).
You might now consider not even bothering with a recordset, and
assigning this SQL string as the recordsource for your form in the
same place that you're now assigning the recordset.
Setting the forms' recordsource sound even better, I'll try that.
BTW, when I tried to join the two tables from the two different
databases I got an error, so I found a workaround.
is the following syntax possible at all?
SELECT field1,field2 from table1 in 'PATH1',table2 in 'PATH2'
WHERE table1.field1=table2.field2
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.