Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using RecordsetClone w/ subform

Status
Not open for further replies.

gottaski

Programmer
Jan 4, 2001
17
US
Does anyone if you can use RecordSetClone w/ a subform and if yes, do you know the correct? I have tried the following:

Set rs = Forms![MainForm]![Subform]!RecordsetClone

and Access97 keeps telling me that it can find the field 'RecordsetClone'.

If I try:

Set rs = Forms![Subform].RecordsetClone

I am told that Access97 can not find my form.

 
Yes I see what you mean.
What are you trying to do there is probably a work around.

I put this code in the Form_Click event of the Subform to sync the main form to a record choosen on the subform.



Private Sub Form_Click()
Dim FormName As String, SyncCriteria As String
Dim f As Form, rs As Recordset

' Main form name to be syncronized
FormName = "AutoCAD"

'Define the form object and recordset object for the AutoCAD form
Set f = Forms(FormName)
Set rs = f.RecordsetClone

' define the criteria used for the sync
SyncCriteria = "[Part_num]=" & Chr$(39) & Me![Part_num] & Chr$(39)

' find the corresponding record in the Parts table
rs.FindFirst SyncCriteria
f.Bookmark = rs.Bookmark

End Sub

DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
Or visit my WEB site
 
Thanks DougP for your help!

Acutally, I just stumbled upon an article in MS Knowledge Base that explains how to duplicate a main form and it's subform detail records -- which is exactly what I am trying to do.

Sorry to have posted before exhausting all other search options.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top