View Single Post
  #9  
Old May 25th, 2010, 05:04 PM posted to microsoft.public.access.reports
MNJoe
external usenet poster
 
Posts: 30
Default change control source or value of text box

Just as a test I tried this. =nz([Line_Desired_Recv_Date],"99/99/99") and
this worked. For some reason I put in the PO_Desired_Recv_Date and I get
#error for output. ????? Yet when I output just the PO_Desired_Recv_Date it
outputs the po date.

--
MNJoe


"MNJoe" wrote:

I was able to change the query where it now has PO_Desired_Recv_Date and
Line_Desired_Recv_Date as you suggested. I put each of these dates in the
control and run the report just to verify that they work and dates are
output. when I put the equation
=nz([Line_Desired_Recv_Date],[PO_Desired_Recv_Date]) , it still puts out
"#error" on the report when ever the line date is null. It puts out the line
date correctly when it is not null. I looked up the function NZ and was
wondering. Is it for numbers only? The only examples I could find were for
when a number is null it would return 0 or some other number.

thanks for all your help
--
MNJoe


"Duane Hookom" wrote:

Does your report record source actually return two date fields with the same
field name? This would create an issue. I would rename the Line date and PO
desired received dates to
Line_Desired_Recv_Date and PO_Desired_Recv_Date. Then you can use:

=nz([Line_Desired_Recv_Date],[PO_Desired_Recv_Date ])

IMO, you should never create queries that return the same field name more
than once without creating ALIASES.
--
Duane Hookom
Microsoft Access MVP

NOTE: These public News Groups are ending June 1st. Consider asking
questions at http://social.answers.microsoft.com/...ddbuz/threads?


"MNJoe" wrote:

Does not work completely. These are the fields from the query

SYSADM_PURC_ORDER_LINE.DESIRED_RECV_DATE
SYSADM_PURCHASE_ORDER.DESIRED_RECV_DATE

My text control names are

PO_Due_Date
PO_Line_Due_Date

When I do this line

=nz(SYSADM_PURC_ORDER_LINE.DESIRED_RECV_DATE,SYSAD M_PURCHASE_ORDER.DESIRED_RECV_DATE)

It wants me to enter in the SYSADM_PURC_ORDER_LINE

when I do this (square brackets at begining and end of the field)

=nz([SYSADM_PURC_ORDER_LINE.DESIRED_RECV_DATE],[SYSADM_PURCHASE_ORDER.DESIRED_RECV_DATE])

Where there is a date for the po line I get that date, for when the date is
null or blank I get "#error".

When I do this . (square brackets surrounding table and field of query)

=nz([SYSADM_PURC_ORDER_LINE].[DESIRED_RECV_DATE],[SYSADM_PURCHASE_ORDER].[DESIRED_RECV_DATE])

It again wants me to enter the SYSADM_PURC_ORDER_LINE

Any help is very appreciated.

Thanks
--
MNJoe


"Duane Hookom" wrote:

I expect you can simply set the control source to:
=Nz([Line Due Date Field],[PO Due Date Field])
Make sure the name of the control is not the name of a field.

--
Duane Hookom
MS Access MVP

"MNJoe" wrote in message
...
I have a report with GroupHeader0 and GroupHeader1. The data source of the
report is a query. In the GroupHeader0 I have the Purchase Order Header
info
which includes the Purchase Order due date. In the GroupHeader1 I have the
Purchase Order line info which includes the line due date. What I need is
if
the line due date is Null or blank to default to the PO header due date.
How
can I assign the header due date to the line due date. Can I change the
control source of the text box in VB programming.

--
MNJoe