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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to refer to Datasheet subform column, row ?

Status
Not open for further replies.

saustin

MIS
Feb 19, 2001
336
0
0
US
Hi All,
Apologize if this has been covered before but the search capability is not up.
Created a subform datasheet and it displays data. Now i need to refer to it (i.e. save a records to another table, print the first two rows etc). How to do this in VBA is the question. Any ideas ? Thanks, Steve.
 
A little more info: are you trying to refer to it in VBA from a mainform? If so you can get to the subforms underlying recorset:

Private Sub Form_Current()
Dim rs As Recordset
Set rs = Me.<subform name>.Form.RecordsetClone
....do what you want
End Sub
 
Thanks for the reply !!! Yes am in the main form when wanting to refer to the data in the subforms. Checked out RecordsetClone in vb help but it is still not clear how to refer to the fields. For example, am displaying 4 columns and perhaps 10 rows of records. Do you use movefirst, movenext?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top