By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 1,302 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Bind the whole method with a text box

P: n/a
I wrote a query in Form_Open method but i didnt bind it with the
textbox. How to i bind this whole method with the text box, as right
now the textbox shows the last value of the recordset. The textbox is a
part of a subform and it shows three times the last value of the record
set.

Private Sub Form_Open(Cancel As Integer)
Dim qry As String, rst As Object
qry = "SELECT tbl_EquipmentChronology.Equipment1 FROM
tbl_EquipmentChronology INNER JOIN tbl_events ON
tbl_events.TicketNum=tbl_EquipmentChronology.Ticke tNum where
tbl_events.TicketNum=" &
Forms!tbl_PPVResearch_Edit!frm_Events!TicketNum & " and
tbl_events.PPVVOD_Outlet=tbl_EquipmentChronology.O utlet"
Set rst = CurrentDb.OpenRecordset(qry)
rst.MoveFirst
Do While Not rst.EOF
Forms!tbl_PPVResearch_Edit!frm_Events!Text2 = rst!Equipment1
rst.MoveNext
Loop
End Sub

Aug 15 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You don't do it this way. Use DSUM and an unbound control.

Aug 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.