Check Box triggers Toggle Button

S

Sondra

I have a form that contains a check box to obsolete a
document. Also associated with the document are several
individual toggle buttons which identify the binders these
documents are in. If the button = yes then the document
is in the binder.

I was trying to write an expression that stated if the
check box = yes then the toggle button should equal no. I
wrote it like this and placed in on the AfterUpdate Event
for each toggle button:

Iif([ObsoleteDoc]= yes, no, yes)

But it isn't working.

1. Do I need to identify the name of the toggle button in
my Iif statement?
2. Is this possible?

Thanks
 
S

Steve Schapel

Sondra,

On the After Update event of the obsolete checkbox, put code equivalent
to...

If Me.ObsoleteDoc Then
Me.YourBinderToggle = 0
End If
 
S

Sondra

Steve:

So don't use the Iif Expression and only use the module
defined below?

But how do I write it for multiple binders? Like this?
If Me.ObsoleteDoc Then
Me.YourBinderToggle = 0
Me.YourBinder2Toggle = 0
Me.YourBinder2Toggle = 0
End If

Thanks
-----Original Message-----
Sondra,

On the After Update event of the obsolete checkbox, put code equivalent
to...

If Me.ObsoleteDoc Then
Me.YourBinderToggle = 0
End If

--
Steve Schapel, Microsoft Access MVP

I have a form that contains a check box to obsolete a
document. Also associated with the document are several
individual toggle buttons which identify the binders these
documents are in. If the button = yes then the document
is in the binder.

I was trying to write an expression that stated if the
check box = yes then the toggle button should equal no. I
wrote it like this and placed in on the AfterUpdate Event
for each toggle button:

Iif([ObsoleteDoc]= yes, no, yes)

But it isn't working.

1. Do I need to identify the name of the toggle button in
my Iif statement?
2. Is this possible?

Thanks
.
 
S

Sondra

I wrote my code as stated:
Private Sub chkObsolete_AfterUpdate()

If Me.Obsolete Then
Me.togMASTER = 0
Me.togIDTSS = 0
Me.togIDCOL = 0
Me.togIDOPs = 0
Me.togIDDnrS = 0
Me.togCOLeBinder = 0
Me.togBOISS = 0
Me.togTFSS = 0
Me.togEDCF = 0
Me.togIDCOLTrain = 0
Me.togUTCFF = 0
Me.togUTAPH = 0
Me.togUTCS = 0
Me.togMEDDIR = 0
Me.togutcoltrn = 0
Me.togGF = 0
Me.togMSRR = 0
Me.togMISARCTRN = 0
Me.togMISBSD = 0
Me.togMIS3017f = 0
Me.togMIS3031ja = 0
Me.togMIS3031F = 0
Me.togMIS3051ja = 0
Me.togMISSys3 = 0
Me.togmissys14 = 0
Me.togMIS3034F = 0
Me.togMIS3031ja = 0
Me.togmissys8 = 0
End If
End Sub

But it is not working. None of the toggle buttons
become "NO" when they are currently marked "YES".

Please advise.
-----Original Message-----
Steve:

So don't use the Iif Expression and only use the module
defined below?

But how do I write it for multiple binders? Like this?
If Me.ObsoleteDoc Then
Me.YourBinderToggle = 0
Me.YourBinder2Toggle = 0
Me.YourBinder2Toggle = 0
End If

Thanks
-----Original Message-----
Sondra,

On the After Update event of the obsolete checkbox, put code equivalent
to...

If Me.ObsoleteDoc Then
Me.YourBinderToggle = 0
End If

--
Steve Schapel, Microsoft Access MVP

I have a form that contains a check box to obsolete a
document. Also associated with the document are several
individual toggle buttons which identify the binders these
documents are in. If the button = yes then the document
is in the binder.

I was trying to write an expression that stated if the
check box = yes then the toggle button should equal no. I
wrote it like this and placed in on the AfterUpdate Event
for each toggle button:

Iif([ObsoleteDoc]= yes, no, yes)

But it isn't working.

1. Do I need to identify the name of the toggle
button
.
 
S

Steve Schapel

Sondra,

There is an inconsistency here. It looks like the obsolete control is
called chkObsolete whereas the code refers to Me.Obsolete. Maybe is
should be...

If Me.chkObsolete Then
...

--
Steve Schapel, Microsoft Access MVP
I wrote my code as stated:
Private Sub chkObsolete_AfterUpdate()

If Me.Obsolete Then
Me.togMASTER = 0
Me.togIDTSS = 0
Me.togIDCOL = 0
Me.togIDOPs = 0
Me.togIDDnrS = 0
Me.togCOLeBinder = 0
Me.togBOISS = 0
Me.togTFSS = 0
Me.togEDCF = 0
Me.togIDCOLTrain = 0
Me.togUTCFF = 0
Me.togUTAPH = 0
Me.togUTCS = 0
Me.togMEDDIR = 0
Me.togutcoltrn = 0
Me.togGF = 0
Me.togMSRR = 0
Me.togMISARCTRN = 0
Me.togMISBSD = 0
Me.togMIS3017f = 0
Me.togMIS3031ja = 0
Me.togMIS3031F = 0
Me.togMIS3051ja = 0
Me.togMISSys3 = 0
Me.togmissys14 = 0
Me.togMIS3034F = 0
Me.togMIS3031ja = 0
Me.togmissys8 = 0
End If
End Sub

But it is not working. None of the toggle buttons
become "NO" when they are currently marked "YES".

Please advise.

-----Original Message-----
Steve:

So don't use the Iif Expression and only use the module
defined below?

But how do I write it for multiple binders? Like this?
If Me.ObsoleteDoc Then
Me.YourBinderToggle = 0
Me.YourBinder2Toggle = 0
Me.YourBinder2Toggle = 0
End If

Thanks

-----Original Message-----
Sondra,

On the After Update event of the obsolete checkbox, put

code equivalent
to...

If Me.ObsoleteDoc Then
Me.YourBinderToggle = 0
End If

--
Steve Schapel, Microsoft Access MVP


Sondra wrote:

I have a form that contains a check box to obsolete a
document. Also associated with the document are
several

individual toggle buttons which identify the binders
these

documents are in. If the button = yes then the
document

is in the binder.

I was trying to write an expression that stated if the
check box = yes then the toggle button should equal

no. I
wrote it like this and placed in on the AfterUpdate
Event

for each toggle button:

Iif([ObsoleteDoc]= yes, no, yes)

But it isn't working.

1. Do I need to identify the name of the toggle
button
in

my Iif statement?
2. Is this possible?

Thanks

.

.
 
Top