Boas.
Como adapto esse código para buscar o mínimo para formulário desvinculado.
*******************************************************************
' AMPLITUDE (MINIMO)
Public Sub obertmin()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb
Set rs = db.OpenRecordset("select * from CartaControlo where nop=" & Me.nop)
DoCmd.RunCommand acCmdSaveRecord
If rs.RecordCount = 0 Then Exit Sub
While Not rs.EOF
z = rs("denier1").Value
If rs("denier2").Value < z Then z = rs("denier2").Value
If rs("denier3").Value < z Then z = rs("denier3").Value
If rs("denier4").Value < z Then z = rs("denier4").Value
If rs("denier5").Value < z Then z = rs("denier5").Value
If rs("denier6").Value < z Then z = rs("denier6").Value
rs.MoveNext
Wend
rs.Close
End Sub
*****************************************************
Como adapto esse código para buscar o mínimo para formulário desvinculado.
*******************************************************************
' AMPLITUDE (MINIMO)
Public Sub obertmin()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Set db = CurrentDb
Set rs = db.OpenRecordset("select * from CartaControlo where nop=" & Me.nop)
DoCmd.RunCommand acCmdSaveRecord
If rs.RecordCount = 0 Then Exit Sub
While Not rs.EOF
z = rs("denier1").Value
If rs("denier2").Value < z Then z = rs("denier2").Value
If rs("denier3").Value < z Then z = rs("denier3").Value
If rs("denier4").Value < z Then z = rs("denier4").Value
If rs("denier5").Value < z Then z = rs("denier5").Value
If rs("denier6").Value < z Then z = rs("denier6").Value
rs.MoveNext
Wend
rs.Close
End Sub
*****************************************************