Orden de tabulacion
Publicado por Luis (24 intervenciones) el 27/11/2015 17:22:14
Cree un formulario con varias cajas de texto, luego agrege otro grupo de cajas de texto. Lo que quiero es que la momento de recorrerlas por codigo empiece con las primeras y luego por las segundas, pero no se por que no lo hace de esa manera y me refiero al codigo, puesto que el orden de tabulacion es el correcto, lo asigne meduiante la caja para el orden de tabulacion, luego tb probe cambiar los nombres de las cajas etc... pero sigue sin responder.. ayuda plis.. este es el codigo..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Public Sub CargarDetalle(datFecha As Date)
Dim ctl As Control, _
rst As DAO.Recordset, _
strSQL As String
' abro un recordset con la tabla notas
strSQL = "SELECT Dia, Hora, Nota "
strSQL = strSQL & " FROM tblNotas "
strSQL = strSQL & " WHERE " & BuildCriteria("Dia", dbDate, "=" & datFecha)
strSQL = strSQL & " ORDER BY Hora"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
' recorro los controles del formulario verificando si empiezan por txtNota
For Each ctl In Me.Controls
If Left(ctl.Name, 7) = "txtNota" Then
'MsgBox (ctl.Name)
'If Not (rst.EOF And rst.BOF) Then
If Not (rst.EOF And rst.BOF) Then
If Not rst.EOF Then
If Val(Mid(ctl.Name, 8)) = rst!Hora Then
ctl.Value = rst!Nota
If Not rst.EOF Then rst.MoveNext
End If
End If
Else
ctl.Value = ""
End If
End If
Next ctl
CierraRecordsetDAO rst
End Sub
Valora esta pregunta


0