Connecting Tech Pros Worldwide Help | Site Map

Bind the whole method with a text box

Eric
Guest
 
Posts: n/a
#1: Aug 15 '06
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

pietlinden@hotmail.com
Guest
 
Posts: n/a
#2: Aug 16 '06

re: Bind the whole method with a text box


You don't do it this way. Use DSUM and an unbound control.

Closed Thread