Hello folks!
I am struggling my way though creating some reports. They were created by saving forms as reports since they are not grouped/aggregated like many reports are. An example recordsource is below. Most of the fields are short or long text fields and they are not always filled out by the user, which is fine as not all fields are always applicable. I have the controls set to "can grow" and "can shrink" since the amount of text in them varies widely. However due to this when the control is null that text box disappears and the report's formatting gets jumbled. When the report is opened I would like the null text boxes to display " --" to indicate that no data was entered there, rather than the viewer wondering whether something is missing. (I've tried doing this in the format property of the control and/or of the table field but have discovered that causes truncation of text over 255 characters for long text fields.) Through many searches and code attempts I have arrived at the solution of doing something in the report's "on load" event such that it checks if a control value is null and puts something there if it is, however I am having trouble doing this. I am thinking I should use a Nz () or IIF () function (?)
So far I'm thinking something like this but it doesn't work and I wouldn't know how to efficiently string together a statement for multiple controls:
Private Sub Report_Load()
Dim Nills As String
Nills = Nz(Me.txtPulseQual, " --")
End Sub
Not sure if I'm on the right track. Any help appreciated!!!
Recordsource example:
SELECT ExamTable.ExamDate, ExamTable.CauseforExam, ExamTable.[Animal/GroupAge], ExamTable.Weight, ExamTable.WeightUnits, ExamTable.BodyTemp, ExamTable.TempUnits, ExamTable.RespRate, ExamTable.HeartRate, ExamTable.PulseQuality, ExamTable.CapillaryRefillTime, ExamTable.VitalsNotes, ExamTable.HistoryCheck, ExamTable.AppearanceGait, ExamTable.HEENM, ExamTable.Samples, ExamTable.DiseaseSigns, ExamTable.AnimalIDFK, ExamTable.ExamAutoID, ExamTable.ImpressionDiagnosis, ExamTable.TreatmentPlan, ExamTable.ReevaluationPlan, AnimalTable.FacilityAnimalID, AnimalTable.Species, AnimalTable.CommonName, AnimalTable.Sex
FROM AnimalTable INNER JOIN ExamTable ON AnimalTable.AnimalAutoID = ExamTable.AnimalIDFK;