J
Jac Tremblay
Hi,
Here is some code that works well:
' *****
strSQL = "SELECT tblChambre.[No], tblChambre.NomCourt " & _
"FROM tblChambre ORDER BY tblChambre.[No]"
Set rstChb = CurrentDb.OpenRecordset(strSQL)
For intI = 1 To rstChb.RecordCount
intNo = Len(CStr(intI))
strNo = Mid(cstr0, 1, 2 - intNo) & intI
strNomContrôle = cstrLbl & strNo
' Me.Controls(strNomContrôle).Caption = _
' rstChb.Fields("[tblChambre.NomCourt]").Value
Me.Controls(strNomContrôle).Caption = rstChb.Fields(1).Value
rstChb.MoveNext
Next intI
' *****
The commented line does not work even though it should. There must be some
syntax error.
Can someone help me on that?
I would prefer to use "rstChb.Fields("[tblChambre.NomCourt]").Value" rather
than "rstChb.Fields(1).Value" for clarity sake.
Thanks
Here is some code that works well:
' *****
strSQL = "SELECT tblChambre.[No], tblChambre.NomCourt " & _
"FROM tblChambre ORDER BY tblChambre.[No]"
Set rstChb = CurrentDb.OpenRecordset(strSQL)
For intI = 1 To rstChb.RecordCount
intNo = Len(CStr(intI))
strNo = Mid(cstr0, 1, 2 - intNo) & intI
strNomContrôle = cstrLbl & strNo
' Me.Controls(strNomContrôle).Caption = _
' rstChb.Fields("[tblChambre.NomCourt]").Value
Me.Controls(strNomContrôle).Caption = rstChb.Fields(1).Value
rstChb.MoveNext
Next intI
' *****
The commented line does not work even though it should. There must be some
syntax error.
Can someone help me on that?
I would prefer to use "rstChb.Fields("[tblChambre.NomCourt]").Value" rather
than "rstChb.Fields(1).Value" for clarity sake.
Thanks