Populate form from recordset

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

using VBA 2000, in my code I have a query which selects a
recordset. My problem is how to display that recordset
into a form. I tried

If Not recordset.EOF Then
recordset.movefirst
Do Until recordset.EOF
form1.fieldname.text = recordset!firstfield
form1.fieldname.text = recordset!secondfield
recordset.movenext
Loop
End If

but nothing ever shows up. I tried using filename.value
instead of .text but still no luck. When I put breaks
each recordset field and form field have the right values.
Any ideas how to do this properly?
 
I can't because the query will be different depending on
which record is selected.

I ended up creating a new temp table and binding the form
to that new temp table. Then when the query is run it
writes the records to the new table.

Probably not the most efficient way to go about it, but
it works.
 
Ya I told they they'll have to clean it out every so often.

It's a really small temp table (5 fields) and will only
hold about 10 rows at a time. Everytime the user leaves
the form, it deletes everything from the table and
recreates the data based on the selected record on the
parent form.
 
Back
Top