welgonzales
05-19-2011, 09:43 PM
tables:
rsttblFlr (floor seating)
rsttblEmp (employee record)
==================
rsttblFlr.MoveFirst
For x = 1 To rsttblFlr.RecordCount
rsttblFlr.MoveFirst
Do While rsttblFlr.EOF = False
If xSeat = rsttblFlr("SeatNum").Value Then
SIPnum = rsttblFlr("SIPnum").Value
rsttblEmp.Index = "idxSIP"
rsttblEmp.MoveFirst
rsttblEmp.Seek "=", SIPnum
If rsttblEmp.NoMatch Then
MsgBox "Critical Error. Contact the Programmer!", vbCritical, "ERROR"
Exit Sub
Else
Empname = rsttblEmp("fname").Value
LABEL(x).Caption = Empname
End If
Exit Do
Else
rsttblFlr.MoveNext
End If
Loop
Next
I have a form that is like the layout of a small office. I've used the label control to represent seats or chairs. there are about more than 50 seats/labels in the form. The seats have names of the employees. Now I want to load the form and when loaded will fill out the label caption to the name of the employees.
how can I use a control name say a label and include an index with it so when the program loops it will load up the name of the employee base on the seat number stored on the table Flr?
basically, all i want to accomplish is use a label+a value say lblC1 where lbl + C1, lbl + C2....
thanks much and looking forward for any suggestions
rsttblFlr (floor seating)
rsttblEmp (employee record)
==================
rsttblFlr.MoveFirst
For x = 1 To rsttblFlr.RecordCount
rsttblFlr.MoveFirst
Do While rsttblFlr.EOF = False
If xSeat = rsttblFlr("SeatNum").Value Then
SIPnum = rsttblFlr("SIPnum").Value
rsttblEmp.Index = "idxSIP"
rsttblEmp.MoveFirst
rsttblEmp.Seek "=", SIPnum
If rsttblEmp.NoMatch Then
MsgBox "Critical Error. Contact the Programmer!", vbCritical, "ERROR"
Exit Sub
Else
Empname = rsttblEmp("fname").Value
LABEL(x).Caption = Empname
End If
Exit Do
Else
rsttblFlr.MoveNext
End If
Loop
Next
I have a form that is like the layout of a small office. I've used the label control to represent seats or chairs. there are about more than 50 seats/labels in the form. The seats have names of the employees. Now I want to load the form and when loaded will fill out the label caption to the name of the employees.
how can I use a control name say a label and include an index with it so when the program loops it will load up the name of the employee base on the seat number stored on the table Flr?
basically, all i want to accomplish is use a label+a value say lblC1 where lbl + C1, lbl + C2....
thanks much and looking forward for any suggestions