dynamic text box value

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
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
 
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
 
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
 
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
 
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])
 
Back
Top