Hello,
I'm hoping someone can shed some light on why my report does not output
the same results as shown in preview mode, which is to move the
position of a check box based on a field value (see code below). The
code does exactly what I want only in preview mode; it moves the check
box only when the drug criteria is true. However, when I print the
report the check box position remains unchanged.
I tried putting the same code to both the Print and Format events but I
get error message 2101, the setting you entered isn't valid for this
property and highlights the line "intTop = 0.0208. I tried to
troubleshoot the setting but I'm not getting anywhere. I can't figure
out why Access only lets me preview the results and not print them.
I promised my boss this was doable but I'm not sure what I'm doing
wrong. If anyone could give me any help/comments I would truly
appreciate it.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim check As CheckBox
Dim intTop As Integer
Set check = Me.ChkBox202
If Nz([Drug].Value) = "Acetaminophen" Then
intTop = 0.0208
With check
.Top = intTop
End With
End If