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!

Populating Unbound Continuous Form

Status
Not open for further replies.

infomania

Programmer
Oct 27, 2002
148
I am trying to populate an unbound form with the results of a query using the following code:

Private Sub Form_Open(Cancel As Integer)
' set initial values
Dim stSQL As String
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Set conn = CurrentProject.Connection
Set rs = New ADODB.Recordset
stSQL = "SELECT * FROM qselClosingTransfers"
rs.Open stSQL, conn, adOpenStatic
Do While Not rs.EOF
Me.RESD_NAME = rs!RESD_NAME
Me.RESD_NUMBER = rs!RESD_NUMBER
Me.UNIT_NUMBER = rs!UNIT_NUMBER
Me.MOVE_IN_DATE = rs!MOVE_IN_DATE
Me.AMT_IN_ENTRY_FEE = rs!AMT_IN_ENTRY_FEE
Me.AMT_OWED_FOR_CUST_CHG = rs!AMT_OWED_FOR_CUST_CHG
Me.FINAL_BAL = rs!FINAL_BAL
Me.CLOSING_BATCHED = rs!CLOSING_BATCHED
rs.MoveNext
Loop
rs.Close
conn.Close
End Sub

What I get is only the last record in the record set. Is there a way to do this where all the rows of the record set will show up in the form?

thanks, in advance

infomania
 
You may consider a continuous subform bound to qselClosingTransfers or a ListBox with RecordSource set to qselClosingTransfers.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The way the query is designed (including 6 tables), the rescord set is not updateable. I'd like to initialize the data in a continuous, unbound form where I can edit values and add add additional fields before running a SQL updates to the tables involved.
 
in a continuous, unbound form
Sorry, never see that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top