Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / February 2008

Tip: Looking for answers? Try searching our database.

Report Output

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff@Tufts - 27 Feb 2008 19:06 GMT
Hi,

I have a created a check box (on the table, query & form).  The box will
indicate that a number enter in another field is a place holder.  When I run
the report for that field I want the number (font) to be red IF the box has
been checked.

How do I link the checkbox to the field in the report???

Thanks,
Jeff
Evi - 27 Feb 2008 19:34 GMT
Assuming the check box is a field in your table and not just in your form:
We'll call it 'MyCheck' and your other field MyNumber

In the On Format Event of the section that contains the number field type

If Me.MyCheck = True Then
Me.MyNumber.ForeColor = 255
Else
Me.MyNumber.ForeColor = 0
End If

Evi

> Hi,
>
[quoted text clipped - 7 lines]
> Thanks,
> Jeff
Jeff@Tufts - 27 Feb 2008 20:31 GMT
It didn't, I wrote exactly what you did and when I recheck the syntax it was
all garbled.

> Assuming the check box is a field in your table and not just in your form:
> We'll call it 'MyCheck' and your other field MyNumber
[quoted text clipped - 22 lines]
> > Thanks,
> > Jeff
Evi - 27 Feb 2008 20:42 GMT
Remember, Jeff, you have to replace MyCheck and MyNumber with the names of
your checkBox field and your number field.
Are you OK with that?
Are you puttting the code in the On Format Event of the report? It goes just
under the line which says (according to what section you put it in)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

(if you put the code in the Detail section of the report)
or
Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)

if you put the code in a Header section of the report.

What do you mean that the Syntax is all garbled? This code does work.

Or have I misunderstood what you require?

Evi

"Jeff@Tufts" <JeffTufts@discussions.microsoft.com> wrote in
> It didn't, I wrote exactly what you did and when I recheck the syntax it was
> all garbled.
[quoted text clipped - 25 lines]
> > > Thanks,
> > > Jeff
Jeff@Tufts - 28 Feb 2008 16:21 GMT
I think you completely understand, however, I'm new to access and have no
idea how to write code.  Right now it's a foreign language.

I did replace the names, but I don't think I used the appropriate commands -
([])= etc.

Would you recommend any books that could help me learn the language?

Thanks,
Jeff

> Remember, Jeff, you have to replace MyCheck and MyNumber with the names of
> your checkBox field and your number field.
[quoted text clipped - 52 lines]
> > > > Thanks,
> > > > Jeff
Evi - 28 Feb 2008 19:30 GMT
No, I wasn't being 'leary' as my son says. I'm still learning too and
finding out new things. I thought you'd learnt a new way of using IIF which
could have been  useful to me.

Until I read one of Allan Browne's recent emails, I didn't know that Access
had a version of Excel's SumIf for True/False answers (other than the DSum
function) in expressions like
= - Sum([Gender] = "M")
which counts all the times Gender = M.

I learnt most of the little I know from the newsgroups and Access 97's Help
file and through doing practical projects. I haven't been able to afford
most of the books you get on Access but of the ones I looked at, some were
so basic as to be impractical and others were so complex that I had no idea
what they were on about. I'm sure there are some recent ones out there,
especially those written by the Access MVPs which will fill that gap.

Evi

> I think you completely understand, however, I'm new to access and have no
> idea how to write code.  Right now it's a foreign language.
[quoted text clipped - 63 lines]
> > > > > Thanks,
> > > > > Jeff
Jeff@Tufts - 29 Feb 2008 18:09 GMT
Would it look like this?

If Me.GradePlaceHolder1 = True Then Me.fp-crwn6-y4.ForeColor = 255 Else
Me.fp-crwn6-y4.ForeColor = 0 End If

It seems like I'm missing all the ( ) & [ ] and stuff?????

> No, I wasn't being 'leary' as my son says. I'm still learning too and
> finding out new things. I thought you'd learnt a new way of using IIF which
[quoted text clipped - 90 lines]
> > > > > > Thanks,
> > > > > > Jeff
Jeff@Tufts - 29 Feb 2008 18:21 GMT
This is what happened.

"If (Gra"d"ePla"c\eh"ol"d"er1 = True) T"h\en" (fp-"c\rwn"6-"y"4.Fore"c"olor  
= 255) El"s"e (fp-"c\rwn"6-"y"4.Fore"c"olor = 0) E"nd" I"

> Would it look like this?
>
[quoted text clipped - 97 lines]
> > > > > > > Thanks,
> > > > > > > Jeff
Jeff@Tufts - 29 Feb 2008 18:28 GMT
Then this happened.

"If "m"e.Gra"d"ePla"c\eh"ol"d"er1 = True T"h\en
m"e.fp-"c\rwn"6-"y"4.Fore"c"olor = 255 El"s"e
"m"e.fp-"c\rwn"6-"y"4.Fore"c"olor = 0 E"

> This is what happened.
>
[quoted text clipped - 102 lines]
> > > > > > > > Thanks,
> > > > > > > > Jeff
Evi - 29 Feb 2008 18:55 GMT
The Syntax was visible when you viewed the report????

Are you, by any chance, putting this code into a text box?

If yes, take it out.

In Design View Click on the grey  bar above the white section that contains
your  control (ie your fp-crwn6-y4 field/textbox).

Click on the Properties box on the toolbar. At the top of the Properties box
window you should something like GroupHeader0 or Detail.

Click on the Event tab
Click the down arrow next to the line that says On Format
Choose Event Procedure
Click the grey area to the right of that (3 dots will appear in the grey
bar)

You will see something like this appear on a code page

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)

End Sub

The first line may have something other than GroupHeader0 if your Control is
in the details section but it will look similar

Paste the code between the 2 lines so that the whole thing says something
like

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If Me.GradePlaceHolder1 = True Then
Me.[fp-crwn6-y4].ForeColor = 255
Else
Me.[fp-crwn6-y4].ForeColor = 0
End If
End Sub

Now open your report. We WILL crack this Jeff!

Evi

> Then this happened.
>
[quoted text clipped - 108 lines]
> > > > > > > > > Thanks,
> > > > > > > > > Jeff
Jeff@Tufts - 29 Feb 2008 19:20 GMT
IT WORKED! IT WORKED!

You freak'n ROCK!!!!

Thank You, Thank You.

> The Syntax was visible when you viewed the report????
>
[quoted text clipped - 179 lines]
> > > > > > > > > > Thanks,
> > > > > > > > > > Jeff
Evi - 29 Feb 2008 19:54 GMT
It would have worked earlier if I'd listened to my hubby and stopped talking
in Databasese. Thanks for letting me know, Jeff
Evi

> IT WORKED! IT WORKED!
>
[quoted text clipped - 162 lines]
> > > > > > > > > > "Jeff@Tufts" <JeffTufts@discussions.microsoft.com> wrote in
> > message

news:F423C403-E115-46CA-9140-CAE3816850A3@microsoft.com...
> > > > > > > > > > > Hi,
> > > > > > > > > > >
[quoted text clipped - 18 lines]
> > > > > > > > > > > Thanks,
> > > > > > > > > > > Jeff
Evi - 29 Feb 2008 18:21 GMT
If you've got field names with spaces or symbols then you will need the []
to show Access they are field names so

If Me.GradePlaceHolder1 = True Then
Me.[fp-crwn6-y4].ForeColor = 255
Else
Me.[fp-crwn6-y4].ForeColor = 0
End If

> Would it look like this?
>
[quoted text clipped - 97 lines]
> > > > > > > Thanks,
> > > > > > > Jeff
Jeff@Tufts - 29 Feb 2008 18:35 GMT
When I did it that way the syntax was viewable when I switched over to view
the report....

> If you've got field names with spaces or symbols then you will need the []
> to show Access they are field names so
[quoted text clipped - 125 lines]
> > > > > > > > Thanks,
> > > > > > > > Jeff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.