S
stickandrock
I have a Record set loop set up in Vb. During the loop I want to utilize a
field returned within a command that uses another field with part of the same
name....
Table : Facilities
Field: Facility (Values 100,200,300,400)
I have a form that has 10 textboxes that are labeled Tot100Cnt, Tot200Cnt,
Tot300Cnt, etc..
I want to requery the textboxes utilizing the Recordset loop. Problem is I
am not sure how I need to format the command utilizing the returned recordset
field as part of the requery line. I don't want to code each field
independantly if I can use a looping function...
Hope this all makes sense....
sample code:
strSQL = "SELECT [FacilityList].Facility FROM [FacilityList] ORDER BY
[FacilityList].Facility"
Set rst = CurrentDb.OpenRecordset(strSQL)
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While Not rst.EOF
Forms!main!Tot100Cnt.Requery
' Replacing "100" with the rst![Facility]
field
rst.MoveNext
Loop
End If
field returned within a command that uses another field with part of the same
name....
Table : Facilities
Field: Facility (Values 100,200,300,400)
I have a form that has 10 textboxes that are labeled Tot100Cnt, Tot200Cnt,
Tot300Cnt, etc..
I want to requery the textboxes utilizing the Recordset loop. Problem is I
am not sure how I need to format the command utilizing the returned recordset
field as part of the requery line. I don't want to code each field
independantly if I can use a looping function...
Hope this all makes sense....
sample code:
strSQL = "SELECT [FacilityList].Facility FROM [FacilityList] ORDER BY
[FacilityList].Facility"
Set rst = CurrentDb.OpenRecordset(strSQL)
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While Not rst.EOF
Forms!main!Tot100Cnt.Requery
' Replacing "100" with the rst![Facility]
field
rst.MoveNext
Loop
End If