Help wth RecordsetClone.FindFirst

D

Dave

Hi, all

I have a form "log" with tabs on it ,one of the tabs via a button opens a
form called "Date_Status_Form" embedded in this form I have a subform
"Top_Date_Status_Query" which displays data in a continues format. At the
moment I have placed a control button on the "Date_Status_Form" with the
following code
Forms!Log.TabCtl0.Value = 2
Forms!Log.RecordsetClone.FindFirst _
"[IDAndProjectRef]='" &
Me.Top_Date_Status_Query.Form.[txtIDAndProjectRef].Value & "'"

Forms!Log.Bookmark = Forms!Log.RecordsetClone.Bookmark

so when I select a record in the subform and click the button on the
Date_Status_Form" the "log" form selects the record from the the data in a
text box called "txtIDAndProjectRef"

The above idea works with no problems, however how would I modify the code
so all I need to do would be to double click any of the "txtIDAndProjectRef"
fields in the "Top_Date_Status_Query" subform to select the record in the
"log" form.

Thank you
 
M

Marshall Barton

Dave said:
I have a form "log" with tabs on it ,one of the tabs via a button opens a
form called "Date_Status_Form" embedded in this form I have a subform
"Top_Date_Status_Query" which displays data in a continues format. At the
moment I have placed a control button on the "Date_Status_Form" with the
following code
Forms!Log.TabCtl0.Value = 2
Forms!Log.RecordsetClone.FindFirst _
"[IDAndProjectRef]='" &
Me.Top_Date_Status_Query.Form.[txtIDAndProjectRef].Value & "'"

Forms!Log.Bookmark = Forms!Log.RecordsetClone.Bookmark

so when I select a record in the subform and click the button on the
Date_Status_Form" the "log" form selects the record from the the data in a
text box called "txtIDAndProjectRef"

The above idea works with no problems, however how would I modify the code
so all I need to do would be to double click any of the "txtIDAndProjectRef"
fields in the "Top_Date_Status_Query" subform to select the record in the
"log" form.


Unless there is more to it than that, just move the button's
code to the text box's DoubleClick event procedure.
 
M

Marshall Barton

When I do that I get the following compile error
method or data member not found
Highlighting in yellow "Private Sub txtProgDate_DblClick(Cancel As Integer)"
and in blue "Top_Date_Status_Query"



I think I am lost in all these subform levels. On
rereading, I think the code needs to be modified to work
from the subsubform (instead of from the subform). Try
something more like:

Forms!Log.TabCtl0.Value = 2
With Forms!Log.RecordsetClone
.FindFirst "IDAndProjectRef='" & _
Me.txtIDAndProjectRef & "'"
If Not .NoMatch Then
Forms!Log.Bookmark = .Bookmark
End If
End With
 
D

djf

Thank you for the suggestion. I had to modify the code as you can see as I
was still having problems.

Forms!Log.TabCtl0.Value = 2
Forms!Log.RecordsetClone.FindFirst _
"IDAndProjectRef='" & Me.txtIDAndProjectRef & "'"
Forms!Log.Bookmark = Forms!Log.RecordsetClone.Bookmark

Code works find now , thank you for you time again
 
Top