D
Dale Fye
Neil,
A couple of issues.
1. you don't need or want to reference Me when referring
to the parent form, although you could, I prefer the
technique shown below.
2. you need to make sure you do something if the
findfirst method fails to find the value you are looking
for:
Dim strCriteria as string
Dim rs as recordset
strCriteria = "[Project Number] = " & Forms("Plan
Status").[ProjectNumber]
set rs = me.recordsetclone
rs.findfirst strCriteria
if rs.nomatch then
if me.
A couple of issues.
1. you don't need or want to reference Me when referring
to the parent form, although you could, I prefer the
technique shown below.
2. you need to make sure you do something if the
findfirst method fails to find the value you are looking
for:
Dim strCriteria as string
Dim rs as recordset
strCriteria = "[Project Number] = " & Forms("Plan
Status").[ProjectNumber]
set rs = me.recordsetclone
rs.findfirst strCriteria
if rs.nomatch then
if me.
Me.RecordsetClone.FindFirst >Status]![ProjectNumber]
-----Original Message-----
I have a main form with a subform on it. Within the subform I have a command
button that opens another form depending on what the value of the combo box
next to it contains. What I would like for the opened form to do, is to go
to a record that matches a field in the main form [Project Number]. And if
one doesn't exist, I'd like it to create a new record with the Project Number
filled in from the main form. I've tried this goto record command thus far
to go to the record containing the Project Number:
Me.RecordsetClone.FindFirst "[Project Number] = " & Me! [Forms]![Plan
Status]![ProjectNumber]
Me.Bookmark = Me.RecordsetClone.Bookmark
But it's saying it can't find the field "Forms" reffered to in my
expression. Any ideas on this and the new record option? Or should I give
up hope and try another approach? Thanks in advance
.