dynamic text box value

M

Mark Kubicki

I have in the detail portion of a report a text box: txtDescription, which I
would like to have display one of the form's recordsource fields
[FullDescription] & [InstNotes] if another of the fields [Void] is FALSE,
and a constant "VOID" if [Void] is true

To achieve this, I've entered the following code (it doesn't work, and any
suggestions would be greatly appreciated. )

If VOID Then
Me.Description = "VOID"
Else
Me.Description = [FullDescription] & [InstNotes]
End If

....have also tried: Me.Description.ControlSource = "VOID", which did not
work either

thanks in advance,
mark
 
J

Jeff Boyce

Mark

Have you tried inserting a breakpoint in the procedure so you can inspect
the values that ARE in [VOID], and [FullDescription] & [InstNotes]?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Mark Kubicki

YES,
I am getting -1 or 0 for the [void] value, and text for the
[FullDescription] & [InstNotes]; however, it will not allow me to assign a
value to this object (a text box) ...run-time error '-2147352567
(80020009)'

thanks in advance,
mark

Jeff Boyce said:
Mark

Have you tried inserting a breakpoint in the procedure so you can inspect
the values that ARE in [VOID], and [FullDescription] & [InstNotes]?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Mark Kubicki said:
I have in the detail portion of a report a text box: txtDescription, which
I would like to have display one of the form's recordsource fields
[FullDescription] & [InstNotes] if another of the fields [Void] is FALSE,
and a constant "VOID" if [Void] is true

To achieve this, I've entered the following code (it doesn't work, and
any suggestions would be greatly appreciated. )

If VOID Then
Me.Description = "VOID"
Else
Me.Description = [FullDescription] & [InstNotes]
End If

...have also tried: Me.Description.ControlSource = "VOID", which did not
work either

thanks in advance,
mark
 
J

Jeff Boyce

Mark

Are there validation rules on those fields?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Mark Kubicki said:
YES,
I am getting -1 or 0 for the [void] value, and text for the
[FullDescription] & [InstNotes]; however, it will not allow me to assign a
value to this object (a text box) ...run-time error '-2147352567
(80020009)'

thanks in advance,
mark

Jeff Boyce said:
Mark

Have you tried inserting a breakpoint in the procedure so you can inspect
the values that ARE in [VOID], and [FullDescription] & [InstNotes]?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Mark Kubicki said:
I have in the detail portion of a report a text box: txtDescription,
which I would like to have display one of the form's recordsource fields
[FullDescription] & [InstNotes] if another of the fields [Void] is FALSE,
and a constant "VOID" if [Void] is true

To achieve this, I've entered the following code (it doesn't work, and
any suggestions would be greatly appreciated. )

If VOID Then
Me.Description = "VOID"
Else
Me.Description = [FullDescription] & [InstNotes]
End If

...have also tried: Me.Description.ControlSource = "VOID", which did not
work either

thanks in advance,
mark
 
D

Duane Hookom

I'm not sure why you are using code when I think you can use a control source
of:
=IIf([Void] = True, "VOID", [FullDescription] & [InstNotes])
 

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