Changing Captions on Toggle Buttons

D

DawnTreader

Hello All

i have a form where i have toggle buttons that i use to filter a query on
the form. the filtering works great, but there are niggly details having to
do with the caption of the buttons.

here is the button code:

Private Sub tglButton_Click()
Select Case tglButton
Case Null
Me.tglButton.Caption = "Show Those"
Case True
Me.tglButton.Caption = "Show These"
Case False
Me.tglButton.Caption = "Show Others"
End Select

Me.subform.Form.Requery

End Sub

the problem comes when it trys to change the caption. in the Null state the
caption doesnt change. it is like the button becomes "locked" from changes
even through code. so it will show the 2 other captions but not the third.

does anyone have any idea how to get around this or an idea of why this
happens? i tried to put a label on top of the button but that gets in the
buttons way. any help would be very appreciated.
 
J

Jeff Boyce

I'm confused ... how do you figure that a toggle button can take a value,
like true or false or null?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
D

DawnTreader

Hello Jeff

i am not "giving" the button a value, i am changing the caption based on the
value of the button when clicked.

create a triple state toggle button on a form, and try the code.
 
J

Jeff Boyce

Your code tries to grab the value of "tglButton" in your Case statement. If
it is the CAPTION property's value you're after, you'll have to spell that
out for Access.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible
 
D

DawnTreader

ok...

i dont want to be sarcastic, so i wont type what i really feel like typing,
especially because you are MVP, but i fail to understand how you cant see
what the code is doing. :\

when someone clicks on the triple state toggle button this code fires, it
reads the value of the button and changes the caption to 'the next value' of
the button so that when the user clicks it they will know how the query will
be filtered. the query looks at the value of the button and requeries to
change the records showing. here is the sql:

SELECT
dbo_CUSTOMER_ORDER.CUSTOMER_ID AS CustID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF AS CustPO,
dbo_CUSTOMER_ORDER.ORDER_DATE AS CODate,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE AS DShipDate,
dbo_CUSTOMER_ORDER.PROMISE_DATE AS PromDate,
dbo_CUSTOMER_ORDER.STATUS AS COStatus,
Sum(([ORDER_QTY]-[TOTAL_SHIPPED_QTY])*([UNIT_PRICE])) AS OpenValue,
Sum(TOTAL_SHIPPED_QTY]*[UNIT_PRICE]) AS ClosedValue,
Sum([ORDER_QTY]*[UNIT_PRICE]) AS TotalOrderValue,
IIf([AftermarketSales]=-1,"True","False") AS VSPF,
dbo_CUSTOMER_ORDER.SALESREP_ID AS VOSP
FROM
qryASPOrderTracker RIGHT JOIN (dbo_CUSTOMER RIGHT JOIN dbo_CUSTOMER_ORDER
ON dbo_CUSTOMER.ID = dbo_CUSTOMER_ORDER.CUSTOMER_ID)
ON qryASPOrderTracker.VisualOrderName = dbo_CUSTOMER_ORDER.SALESREP_ID
WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))
GROUP BY
dbo_CUSTOMER_ORDER.CUSTOMER_ID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF,
dbo_CUSTOMER_ORDER.ORDER_DATE,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE,
dbo_CUSTOMER_ORDER.PROMISE_DATE,
dbo_CUSTOMER_ORDER.STATUS,
IIf([AftermarketSales]=-1,"True","False"),
dbo_CUSTOMER_ORDER.SALESREP_ID
ORDER BY
dbo_CUSTOMER_ORDER.ID DESC;

notice the

WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))

this is where my button comes in. based on the value of the button certain
records will be filtered based on thier yes no value. additionally this
allows for all 3 states of the button so that i get all those orders which
are false or true when the button is in the Null state.

now that i hopefully have explained the background, do you have any idea why
i cannot get the caption of the button to change in the null state? when i
click the button only 2 of the 3 captions i have supplied are showing.

any ideas...?
 
J

John Spencer

Wouldn't the following give you what you want

Where [AftermarketSales]=[Forms]![frmOrderTracker]![tglAftermarket]
OR [Forms]![frmOrderTracker]![tglAftermarket] is Null

As far as you code goes your problem is Case Null. That will never evaluate
to true since Null is Null. Try this rewrite where you force a value of 2 if
the button is null

Private Sub tglButton_Click()
Select Case NZ(tglButton,2)
Case 2
Me.tglButton.Caption = "Show Those"
Case -1
Me.tglButton.Caption = "Show These"
Case 0
Me.tglButton.Caption = "Show Others"
End Select

Me.subform.Form.Requery

End Sub

Another option is

IF IsNull(tglButton) Then
Me.tglButton.Caption = "Show Those"
ElseIF tglButton = True Then
Me.tglButton.Caption = "Show These"
ElseIF tglButton=False Then
Me.tglButton.Caption = "Show Others"
End IF

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
ok...

i dont want to be sarcastic, so i wont type what i really feel like typing,
especially because you are MVP, but i fail to understand how you cant see
what the code is doing. :\

when someone clicks on the triple state toggle button this code fires, it
reads the value of the button and changes the caption to 'the next value' of
the button so that when the user clicks it they will know how the query will
be filtered. the query looks at the value of the button and requeries to
change the records showing. here is the sql:

SELECT
dbo_CUSTOMER_ORDER.CUSTOMER_ID AS CustID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF AS CustPO,
dbo_CUSTOMER_ORDER.ORDER_DATE AS CODate,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE AS DShipDate,
dbo_CUSTOMER_ORDER.PROMISE_DATE AS PromDate,
dbo_CUSTOMER_ORDER.STATUS AS COStatus,
Sum(([ORDER_QTY]-[TOTAL_SHIPPED_QTY])*([UNIT_PRICE])) AS OpenValue,
Sum(TOTAL_SHIPPED_QTY]*[UNIT_PRICE]) AS ClosedValue,
Sum([ORDER_QTY]*[UNIT_PRICE]) AS TotalOrderValue,
IIf([AftermarketSales]=-1,"True","False") AS VSPF,
dbo_CUSTOMER_ORDER.SALESREP_ID AS VOSP
FROM
qryASPOrderTracker RIGHT JOIN (dbo_CUSTOMER RIGHT JOIN dbo_CUSTOMER_ORDER
ON dbo_CUSTOMER.ID = dbo_CUSTOMER_ORDER.CUSTOMER_ID)
ON qryASPOrderTracker.VisualOrderName = dbo_CUSTOMER_ORDER.SALESREP_ID
WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))
GROUP BY
dbo_CUSTOMER_ORDER.CUSTOMER_ID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF,
dbo_CUSTOMER_ORDER.ORDER_DATE,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE,
dbo_CUSTOMER_ORDER.PROMISE_DATE,
dbo_CUSTOMER_ORDER.STATUS,
IIf([AftermarketSales]=-1,"True","False"),
dbo_CUSTOMER_ORDER.SALESREP_ID
ORDER BY
dbo_CUSTOMER_ORDER.ID DESC;

notice the

WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))

this is where my button comes in. based on the value of the button certain
records will be filtered based on thier yes no value. additionally this
allows for all 3 states of the button so that i get all those orders which
are false or true when the button is in the Null state.

now that i hopefully have explained the background, do you have any idea why
i cannot get the caption of the button to change in the null state? when i
click the button only 2 of the 3 captions i have supplied are showing.

any ideas...?
 
J

Jeff Boyce

MVPs don't know it all ... case in point!

Thanks for the clarification...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

DawnTreader said:
ok...

i dont want to be sarcastic, so i wont type what i really feel like
typing,
especially because you are MVP, but i fail to understand how you cant see
what the code is doing. :\

when someone clicks on the triple state toggle button this code fires, it
reads the value of the button and changes the caption to 'the next value'
of
the button so that when the user clicks it they will know how the query
will
be filtered. the query looks at the value of the button and requeries to
change the records showing. here is the sql:

SELECT
dbo_CUSTOMER_ORDER.CUSTOMER_ID AS CustID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF AS CustPO,
dbo_CUSTOMER_ORDER.ORDER_DATE AS CODate,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE AS DShipDate,
dbo_CUSTOMER_ORDER.PROMISE_DATE AS PromDate,
dbo_CUSTOMER_ORDER.STATUS AS COStatus,
Sum(([ORDER_QTY]-[TOTAL_SHIPPED_QTY])*([UNIT_PRICE])) AS OpenValue,
Sum(TOTAL_SHIPPED_QTY]*[UNIT_PRICE]) AS ClosedValue,
Sum([ORDER_QTY]*[UNIT_PRICE]) AS TotalOrderValue,
IIf([AftermarketSales]=-1,"True","False") AS VSPF,
dbo_CUSTOMER_ORDER.SALESREP_ID AS VOSP
FROM
qryASPOrderTracker RIGHT JOIN (dbo_CUSTOMER RIGHT JOIN
dbo_CUSTOMER_ORDER
ON dbo_CUSTOMER.ID = dbo_CUSTOMER_ORDER.CUSTOMER_ID)
ON qryASPOrderTracker.VisualOrderName = dbo_CUSTOMER_ORDER.SALESREP_ID
WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))
GROUP BY
dbo_CUSTOMER_ORDER.CUSTOMER_ID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF,
dbo_CUSTOMER_ORDER.ORDER_DATE,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE,
dbo_CUSTOMER_ORDER.PROMISE_DATE,
dbo_CUSTOMER_ORDER.STATUS,
IIf([AftermarketSales]=-1,"True","False"),
dbo_CUSTOMER_ORDER.SALESREP_ID
ORDER BY
dbo_CUSTOMER_ORDER.ID DESC;

notice the

WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))

this is where my button comes in. based on the value of the button certain
records will be filtered based on thier yes no value. additionally this
allows for all 3 states of the button so that i get all those orders which
are false or true when the button is in the Null state.

now that i hopefully have explained the background, do you have any idea
why
i cannot get the caption of the button to change in the null state? when i
click the button only 2 of the 3 captions i have supplied are showing.

any ideas...?
--
As always, any and all help appreciated! :)


Jeff Boyce said:
Your code tries to grab the value of "tglButton" in your Case statement.
If
it is the CAPTION property's value you're after, you'll have to spell
that
out for Access.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible




.
 
D

DawnTreader

Hello John

NICE! :) that is an answer to a problem i have had for around 6 months!

i knew that it was the null, but couldnt figure out why it would act
differently from the other 2. wow. i have always treated nulls like any other
"character", this has kind of opened my eyes to the special nature of a null.

i have to try the sql, but i think i tried that once before. here goes
nothing... :)
--
As always, any and all help appreciated! :)


John Spencer said:
Wouldn't the following give you what you want

Where [AftermarketSales]=[Forms]![frmOrderTracker]![tglAftermarket]
OR [Forms]![frmOrderTracker]![tglAftermarket] is Null

As far as you code goes your problem is Case Null. That will never evaluate
to true since Null is Null. Try this rewrite where you force a value of 2 if
the button is null

Private Sub tglButton_Click()
Select Case NZ(tglButton,2)
Case 2
Me.tglButton.Caption = "Show Those"
Case -1
Me.tglButton.Caption = "Show These"
Case 0
Me.tglButton.Caption = "Show Others"
End Select

Me.subform.Form.Requery

End Sub

Another option is

IF IsNull(tglButton) Then
Me.tglButton.Caption = "Show Those"
ElseIF tglButton = True Then
Me.tglButton.Caption = "Show These"
ElseIF tglButton=False Then
Me.tglButton.Caption = "Show Others"
End IF

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
ok...

i dont want to be sarcastic, so i wont type what i really feel like typing,
especially because you are MVP, but i fail to understand how you cant see
what the code is doing. :\

when someone clicks on the triple state toggle button this code fires, it
reads the value of the button and changes the caption to 'the next value' of
the button so that when the user clicks it they will know how the query will
be filtered. the query looks at the value of the button and requeries to
change the records showing. here is the sql:

SELECT
dbo_CUSTOMER_ORDER.CUSTOMER_ID AS CustID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF AS CustPO,
dbo_CUSTOMER_ORDER.ORDER_DATE AS CODate,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE AS DShipDate,
dbo_CUSTOMER_ORDER.PROMISE_DATE AS PromDate,
dbo_CUSTOMER_ORDER.STATUS AS COStatus,
Sum(([ORDER_QTY]-[TOTAL_SHIPPED_QTY])*([UNIT_PRICE])) AS OpenValue,
Sum(TOTAL_SHIPPED_QTY]*[UNIT_PRICE]) AS ClosedValue,
Sum([ORDER_QTY]*[UNIT_PRICE]) AS TotalOrderValue,
IIf([AftermarketSales]=-1,"True","False") AS VSPF,
dbo_CUSTOMER_ORDER.SALESREP_ID AS VOSP
FROM
qryASPOrderTracker RIGHT JOIN (dbo_CUSTOMER RIGHT JOIN dbo_CUSTOMER_ORDER
ON dbo_CUSTOMER.ID = dbo_CUSTOMER_ORDER.CUSTOMER_ID)
ON qryASPOrderTracker.VisualOrderName = dbo_CUSTOMER_ORDER.SALESREP_ID
WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))
GROUP BY
dbo_CUSTOMER_ORDER.CUSTOMER_ID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF,
dbo_CUSTOMER_ORDER.ORDER_DATE,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE,
dbo_CUSTOMER_ORDER.PROMISE_DATE,
dbo_CUSTOMER_ORDER.STATUS,
IIf([AftermarketSales]=-1,"True","False"),
dbo_CUSTOMER_ORDER.SALESREP_ID
ORDER BY
dbo_CUSTOMER_ORDER.ID DESC;

notice the

WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))

this is where my button comes in. based on the value of the button certain
records will be filtered based on thier yes no value. additionally this
allows for all 3 states of the button so that i get all those orders which
are false or true when the button is in the Null state.

now that i hopefully have explained the background, do you have any idea why
i cannot get the caption of the button to change in the null state? when i
click the button only 2 of the 3 captions i have supplied are showing.

any ideas...?
.
 
D

DawnTreader

Hello John

oh... i think you got an error in that where statement, the SQL got all
screwed up. design view looked wierd. the tglAftermarket is not a field but
the button on the form.

--
As always, any and all help appreciated! :)


John Spencer said:
Wouldn't the following give you what you want

Where [AftermarketSales]=[Forms]![frmOrderTracker]![tglAftermarket]
OR [Forms]![frmOrderTracker]![tglAftermarket] is Null

As far as you code goes your problem is Case Null. That will never evaluate
to true since Null is Null. Try this rewrite where you force a value of 2 if
the button is null

Private Sub tglButton_Click()
Select Case NZ(tglButton,2)
Case 2
Me.tglButton.Caption = "Show Those"
Case -1
Me.tglButton.Caption = "Show These"
Case 0
Me.tglButton.Caption = "Show Others"
End Select

Me.subform.Form.Requery

End Sub

Another option is

IF IsNull(tglButton) Then
Me.tglButton.Caption = "Show Those"
ElseIF tglButton = True Then
Me.tglButton.Caption = "Show These"
ElseIF tglButton=False Then
Me.tglButton.Caption = "Show Others"
End IF

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
ok...

i dont want to be sarcastic, so i wont type what i really feel like typing,
especially because you are MVP, but i fail to understand how you cant see
what the code is doing. :\

when someone clicks on the triple state toggle button this code fires, it
reads the value of the button and changes the caption to 'the next value' of
the button so that when the user clicks it they will know how the query will
be filtered. the query looks at the value of the button and requeries to
change the records showing. here is the sql:

SELECT
dbo_CUSTOMER_ORDER.CUSTOMER_ID AS CustID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF AS CustPO,
dbo_CUSTOMER_ORDER.ORDER_DATE AS CODate,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE AS DShipDate,
dbo_CUSTOMER_ORDER.PROMISE_DATE AS PromDate,
dbo_CUSTOMER_ORDER.STATUS AS COStatus,
Sum(([ORDER_QTY]-[TOTAL_SHIPPED_QTY])*([UNIT_PRICE])) AS OpenValue,
Sum(TOTAL_SHIPPED_QTY]*[UNIT_PRICE]) AS ClosedValue,
Sum([ORDER_QTY]*[UNIT_PRICE]) AS TotalOrderValue,
IIf([AftermarketSales]=-1,"True","False") AS VSPF,
dbo_CUSTOMER_ORDER.SALESREP_ID AS VOSP
FROM
qryASPOrderTracker RIGHT JOIN (dbo_CUSTOMER RIGHT JOIN dbo_CUSTOMER_ORDER
ON dbo_CUSTOMER.ID = dbo_CUSTOMER_ORDER.CUSTOMER_ID)
ON qryASPOrderTracker.VisualOrderName = dbo_CUSTOMER_ORDER.SALESREP_ID
WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))
GROUP BY
dbo_CUSTOMER_ORDER.CUSTOMER_ID,
dbo_CUSTOMER.NAME,
dbo_CUSTOMER_ORDER.ID,
dbo_CUSTOMER.COUNTRY,
dbo_CUSTOMER_ORDER.CUSTOMER_PO_REF,
dbo_CUSTOMER_ORDER.ORDER_DATE,
dbo_CUSTOMER_ORDER.DESIRED_SHIP_DATE,
dbo_CUSTOMER_ORDER.PROMISE_DATE,
dbo_CUSTOMER_ORDER.STATUS,
IIf([AftermarketSales]=-1,"True","False"),
dbo_CUSTOMER_ORDER.SALESREP_ID
ORDER BY
dbo_CUSTOMER_ORDER.ID DESC;

notice the

WHERE
(((IIf([AftermarketSales]=-1,"True","False"))
In ((IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"False",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=-1,"True","False")))),
(IIf([Forms]![frmOrderTracker]![tglAftermarket] Is Null,"True",
(IIf([Forms]![frmOrderTracker]![tglAftermarket]=0,"False","True"))))))

this is where my button comes in. based on the value of the button certain
records will be filtered based on thier yes no value. additionally this
allows for all 3 states of the button so that i get all those orders which
are false or true when the button is in the Null state.

now that i hopefully have explained the background, do you have any idea why
i cannot get the caption of the button to change in the null state? when i
click the button only 2 of the 3 captions i have supplied are showing.

any ideas...?
.
 

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