You cannot use RecordsetClone for records that are not in the form. As the
name suggests, the clone set contains only the same records as in the form.
You will need to use another approach to retrieving other data from the
table. DLookup() might be the simplest:
http://allenbrowne.com/casu-07.html
OpenRecordset() will be more efficient if you are retrieving multiple
values, but requires some understanding of how to code it. Here's a basic
example:
http://allenbrowne.com/func-DAO.html...cordsetExample
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<Ce****@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
Hello,
I have a form where I only allow new records to be added. I enable
this by setting the form property "Data Entry" to Yes.
I want to access other records in the same table- to autofill the new
record with a user select previous record.
Dim rs As Recordset
Set rs = Me.RecordsetClone
rs.MoveLast
MsgBox rs.RecordCount 'returns error when Data Entry =
Yes
When only allowing new records, this code returns "Run-time error
'3201', No current record." It works fine if the form isn't only
allowing new records.
Thank you in advance for reading this and providing assistance.