Aquiles Vidal
September 28th, 2001, 12:16 PM
Friends of the technical support:
I have a problem with the combined box of Access that work
based on a function of Visual Basic. I use that method because
is more active than the access query´s. The system should
give shifts to patient of a clinic and for the assignment
of schedules it has three tables called Hours, Schedules and
Doctors, and two forms called Doctors and Subform of Schedules.
The Subform of Schedules has a combined box that
choose among M-morning or A-afternoon, and then it has another
combined box that it should get the morning hours or the
afternoon according to the previous election. The section
named acLBGetValue of the function of Visual Basic it gives
the hours values list of another function based on an
instruction SELECT, type DAO.Recordset, with a reference to a
text box, clerk of the first combined box. The problem seems to
be in the filter WHERE of the SELECT that obtains the value of
the first combined box that it choose between morning or
afternoon, because it filters only in the first record,
and it doesn't work for the other records.
The instruction function value of the record is this:
Function ValorDelRegistro(NroRegistro As Integer) As Variant
Dim Cadena As String
Dim REC As DAO.RECORDSET
Let Cadena = "SELECT * FROM Horas WHERE MoA = '" & [Texto1] & "'_
ORDER BY Horas"
Set REC = CurrentDb.OpenRecordset(Cadena)
REC.Move (NroRegistro)
ValorDelRegistro = REC!Horas
REC.Close
End Function
Thank you to try to help me !!!
I have a problem with the combined box of Access that work
based on a function of Visual Basic. I use that method because
is more active than the access query´s. The system should
give shifts to patient of a clinic and for the assignment
of schedules it has three tables called Hours, Schedules and
Doctors, and two forms called Doctors and Subform of Schedules.
The Subform of Schedules has a combined box that
choose among M-morning or A-afternoon, and then it has another
combined box that it should get the morning hours or the
afternoon according to the previous election. The section
named acLBGetValue of the function of Visual Basic it gives
the hours values list of another function based on an
instruction SELECT, type DAO.Recordset, with a reference to a
text box, clerk of the first combined box. The problem seems to
be in the filter WHERE of the SELECT that obtains the value of
the first combined box that it choose between morning or
afternoon, because it filters only in the first record,
and it doesn't work for the other records.
The instruction function value of the record is this:
Function ValorDelRegistro(NroRegistro As Integer) As Variant
Dim Cadena As String
Dim REC As DAO.RECORDSET
Let Cadena = "SELECT * FROM Horas WHERE MoA = '" & [Texto1] & "'_
ORDER BY Horas"
Set REC = CurrentDb.OpenRecordset(Cadena)
REC.Move (NroRegistro)
ValorDelRegistro = REC!Horas
REC.Close
End Function
Thank you to try to help me !!!