Report / VBA Help in Access 2003

spike250

Registered User.
Local time
Today, 18:33
Joined
Aug 6, 2009
Messages
70
Hi,

I have a report with a text box that pulls through a test that is request, this is hidden on the report as I also have x3 check boxes on the report for certain tests.
For Example:
If test displayed is 123 the check box for that test has a control value of =[Test]="123" Which then ticks the box.

This works fine for all the tests with tick boxes the problem I am having is that there is an option for other tests.

I need to somehow get it tick this for all the other tests that havent got tick boxes and also display the hidden test field.

I have tried the following VBA
Code:
If Me.Test="ABC" Then
   Me.Test.Visible=True
   Me.CheckTest=-1
Else
   Me.Test.Visible=False
   Me.CheckTest=0
End If
End Sub

If any one could kindly help me, I have been trying to figure this out for the last few days and it is starting to drive me mad.

Regards

Spike
:confused::confused::confused:
 
Spike where are you placing the code in which part of the report?

It should go in the detail section in the event on Format or On Print, will that do the trick for you.

I use an if statement to highlight a colour based on a payment and it works fine.

My If statement is shown below, Ive highlighted that it is placed in the On Print event.:

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If Me.Date_Paid.Value <> 0 Then
Me.Date_of_Invoice.ForeColor = RGB(255, 0, 0)
Else
Me.Date_of_Invoice.ForeColor = vbBlack
End If

End Sub
 
formatting code in reports should go in the ON FORMAT event, not the ON PRINT event.
 

Users who are viewing this thread

Back
Top Bottom