It's a report that is called from a Main Screeen. The VBA is located in the detail Onformat section of the report. This is
what I got the code down too. I used to have it in the OnPage for the report, however, after some reading I found that it
doens't update the OnPage until after the formating. So it was suggested that I use the OnFormat of the Detail section. This
still doesn't really work. I have a field on the report that has the checkbox for rushed and the PO_Number is listed on the
report as well. I want to have the TextBox93 (I know I didn't name it, Yet!) say Rush Order if in the table the field Rushed
is checked. This is filled via a different form when they enter their purchase orders. I took out the responce code to see
how it flowed without the stops. One thing I did notice is when it was using the msgbox's it seems to evail this code twice
before displaying the first page.
Rushed = the field that is a checkbox that is stored as a lookup and yes/no
so I am seeing in my testing that is either 0 or -1
PO List = my table that stores all the information about each PO.
Me![PO_Number] is the po_number the query pulled to fill the report and is on the report and
[PO_Number] = should be what is pulled from the table PO List to be compared with.
Let me know if you need anything else.... thanks.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
test = DLookup("[Rushed]", "[PO List]", [PO_Number] = Me![PO_Number])
If test = "-1" Then
Me.Controls!Text93 = "Rush Order"
Me.Controls!Text93 = ""