Hello ,I need some help with a Report.
It is based on a query with this criteria in the field document number:
[Forms]![Administrativos3]![Pacientes_Nro de documento]
I have a Form with this fields : Pacientes_Nro de documento , edad , sexo , HTA.
And many reports named Laboratorio .
I try to open the reports with this module :
Private Sub Etiqueta42_Click()
If (Me.Edad >= 50) And (Me.Sexo = "Masculino") And (Me.HTA = 1) = True Then DoCmd.OpenReport "Laboratorio", acViewPreview
If (Me.Edad >= 50) And (Me.Sexo = "Masculino") And (Me.HTA = 2) = True Then DoCmd.OpenReport "Laboratorio2", acViewPreview
If (Me.Sexo = "Femenino") And (Me.HTA = 1) = True Then DoCmd.OpenReport " Laboratorio3", acViewPreview
If (Me.Sexo = "Femenino") And (Me.HTA = 2) = True Then DoCmd.OpenReport "Laboratorio4", acViewPreview
End Sub
The Reports opens properly , i.e. report "Laboratorio" opens if the actual record in the form is >50 ,male and HTA=1 .
But the querys does't work because this same fields are empty in the report.
There is one query for each report and it works if I open the report directly from its icon , but not if I try using the module.
Should I made another module to make de query works?
Is there something bad in the design of this DB?
Thank you very much.
It is based on a query with this criteria in the field document number:
[Forms]![Administrativos3]![Pacientes_Nro de documento]
I have a Form with this fields : Pacientes_Nro de documento , edad , sexo , HTA.
And many reports named Laboratorio .
I try to open the reports with this module :
Private Sub Etiqueta42_Click()
If (Me.Edad >= 50) And (Me.Sexo = "Masculino") And (Me.HTA = 1) = True Then DoCmd.OpenReport "Laboratorio", acViewPreview
If (Me.Edad >= 50) And (Me.Sexo = "Masculino") And (Me.HTA = 2) = True Then DoCmd.OpenReport "Laboratorio2", acViewPreview
If (Me.Sexo = "Femenino") And (Me.HTA = 1) = True Then DoCmd.OpenReport " Laboratorio3", acViewPreview
If (Me.Sexo = "Femenino") And (Me.HTA = 2) = True Then DoCmd.OpenReport "Laboratorio4", acViewPreview
End Sub
The Reports opens properly , i.e. report "Laboratorio" opens if the actual record in the form is >50 ,male and HTA=1 .
But the querys does't work because this same fields are empty in the report.
There is one query for each report and it works if I open the report directly from its icon , but not if I try using the module.
Should I made another module to make de query works?
Is there something bad in the design of this DB?
Thank you very much.