J
Joseph Ellis
Hello all,
I'm delving into working with recordsets for the first time, and
having a heck of a time getting anything to work properly.
I'm trying to use FindFirst to jump to a record in a main form
(frmHouseholds) which has just been selected from a popup "search
results" form. After selecting the desired record in
frmSearchResults, the user clicks a "Done" command button, which hides
frmSearchResults, allowing focus to return to frmHouseholds.
At this point I'd like to jump to the selected record in
frmHouseholds, using hhID as the uniqe value to find:
Dim rst As Recordset
Set rst = forms!frmHouseholds.RecordsetClone
rstDesiredRec.FindFirst "[hhid] = " & Forms!frmSearchResults.hhID
Once I get to the desired record, I'll close frmSearchResults, which
is still hidden at this point.
The problem is that when I click the "Done" button in
frmSearchResults, I get an error: "Run-time error '13': Type
mismatch", and the debugger highlights:
Set rst = forms!frmHouseholds.RecordsetClone
This also happens if I try:
Set rst = Me.RecordsetClone
What am I doing wrong? This is my first time working with recordsets;
I think I must be missing some basic concept.
Thanks,
Joseph
I'm delving into working with recordsets for the first time, and
having a heck of a time getting anything to work properly.
I'm trying to use FindFirst to jump to a record in a main form
(frmHouseholds) which has just been selected from a popup "search
results" form. After selecting the desired record in
frmSearchResults, the user clicks a "Done" command button, which hides
frmSearchResults, allowing focus to return to frmHouseholds.
At this point I'd like to jump to the selected record in
frmHouseholds, using hhID as the uniqe value to find:
Dim rst As Recordset
Set rst = forms!frmHouseholds.RecordsetClone
rstDesiredRec.FindFirst "[hhid] = " & Forms!frmSearchResults.hhID
Once I get to the desired record, I'll close frmSearchResults, which
is still hidden at this point.
The problem is that when I click the "Done" button in
frmSearchResults, I get an error: "Run-time error '13': Type
mismatch", and the debugger highlights:
Set rst = forms!frmHouseholds.RecordsetClone
This also happens if I try:
Set rst = Me.RecordsetClone
What am I doing wrong? This is my first time working with recordsets;
I think I must be missing some basic concept.
Thanks,
Joseph