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

Add Continuous form values to a recordset or Table

Status
Not open for further replies.

GoDucks

Programmer
Jul 7, 2005
5
US
I am creating a continuous form with only 3 fields that will end up having about 30 rows. I want to then be able to take the data on the form and add it to a table. Can someone give me the code to do this since you realy only have 3 field names
 
Hi
I do not think you can have a continuous form, without having a table. :)
 
I select several items from a list box and then I take those items and create the recordsource for the form. on my continuous form I will have a textbox to add some data for each record, then I need to dump the info for each record into a table. I have found info on RecordsetClone which looks like what I want but I am now getting a type mismatch on the line "Set rst = Forms!form2.RecordsetClone" Any ideas
 
How is Dim'ed rst ? Should be:
Dim rst As DAO.Recordset

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I don't see DAO avaliable in my list. I am using Access 2003. here is the code I am using
Dim rst As ADODB.Recordset
Set rst = Forms!form2.RecordsetClone
Dim str As String
Do While Not rst.EOF
str = rst.Fields("{ID}").Value
str = str & " " & rst.Fields("{Ename}").Value
str = str & " " & rst.Fields("{Text2}").Value
str = str & vbCrLf
rst.MoveNext
Loop
Debug.Print str
 
menu Tools -> References ...
select the Microsoft DAO 3.6 library.
And now your code:
Dim rst As [highlight]DAO[/highlight].Recordset
Set rst = Forms!form2.RecordsetClone
Dim str As String
Do While Not rst.EOF
str = rst("ID")
str = str & " " & rst("Ename")
str = str & " " & rst("Text2")
str = str & vbCrLf
rst.MoveNext
Loop
Set rst = Nothing
Debug.Print str

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top