Check Box Mental Block

A

Access101

In Acc2003, I create a blank db1.mdb, with a single Table1, and a single
field YN which is a Yes/No data type.

Using the Report wizard, and selecting Column type, I base a report on Table
1 with YN field included.

Here's the code I want to write ...
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.YN.Value = True Then

However, there is no "VALUE" option when I begin typing "Me.YN.________"

Even if I change it to this: If Me.YN = True Then
Upon opening the Report, I still get error 2427, "You Entered an Expression
that has no value."

I swear I've written code for check boxes that allow for this: Me.YN.Value

any help is appreciated.
 
J

John Spencer

Do you have any records in the table?

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
A

Access101

Thanks so much for your quick responses. Yes, I have data in the table, as
well as bound controls in the detail section (via the Report Wizard's
AutoReport: Columns)

This code, at least, yields a "0" for record one, and a "-1" for record two
(and this is correct):

MsgBox Me.YN

What confuses me, is there is no VISIBLE or ENABLED property choice in the
dropdown when entering another "dot" at the end of "YN" within the module:

Me.YN. __________??

The only options that appear are these:

Application, Column, Controls, DropDown, Form, Hyperink, ItemData,
ItemsSelected, move, Object, ObjectVerbs, OldValue, Pages, Parent,
Properties, Report, Requery, Selected, SetFocus, SizetoFit, SmartTags, Undo

I know I've seen VISIBLE, ENABLED, etc. on this list in the past.

What's worse, is that the Text control (I added a text field in the Table1
as well--so it is also bound within the Report) doesn't have VISIBLE or
ENABLED either.
 
D

Duane Hookom

Have you tried renaming the control and updating your code?
Could you provide your complete code?
 
E

Evi

There are quite a few functions that don't appear in the DropDown but they
still work. Nearly all the formats in Properties (with the spaces removed)
that I have tried out so far, work.
eg
Me.NameOfMyControl.ForeColor = 255

will make your control's font red

Me.MyControl.Visible = False

does work if you have a control called MyControl (this is not the same as
having a field name called MyControl)

If Me.YN = True Then
Me.MyYN.Visible = True
Else
Me.MyYN.Visible = False
End If

should work in the OnFormat event.

The important bit of the drop down is the bit after Me.

If your control isn't there, then it may have a different name from the one
you think that it has.

Evi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top