M
Maarkr
I've got about 30 images to loop thru by checking if it's in the recordset
then make it visible if it's in the [LOC] field... this works but can u
suggest how to get my ten varying values from the [loc] field (like W-1, W-2,
N-1...) to match one of the 30 images... I can use any name for the image, in
this case it was W1, W2...
I just didn't want to use 30 instances of then If-Then routine.
Function DAORecEx()
Dim rs As DAO.Recordset
Dim strSql As String, strPSpot As String
strSql = "SELECT LOC FROM tblStatus;"
Set rs = DBEngine(0)(0).OpenRecordset(strSql)
Do While Not rs.EOF
'Debug.Print rs!Loc
strPSpot = rs![Loc]
If strPSpot = "W-1" Then
Me.W1.Visible = True
End If
If strPSpot = "W-2" Then
Me.W2.Visible = True
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Function
then make it visible if it's in the [LOC] field... this works but can u
suggest how to get my ten varying values from the [loc] field (like W-1, W-2,
N-1...) to match one of the 30 images... I can use any name for the image, in
this case it was W1, W2...
I just didn't want to use 30 instances of then If-Then routine.
Function DAORecEx()
Dim rs As DAO.Recordset
Dim strSql As String, strPSpot As String
strSql = "SELECT LOC FROM tblStatus;"
Set rs = DBEngine(0)(0).OpenRecordset(strSql)
Do While Not rs.EOF
'Debug.Print rs!Loc
strPSpot = rs![Loc]
If strPSpot = "W-1" Then
Me.W1.Visible = True
End If
If strPSpot = "W-2" Then
Me.W2.Visible = True
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Function