Form/Sub Form Problem

  • Thread starter Thread starter Quench
  • Start date Start date
Q

Quench

I have a continuous sub form displaying in a form. I have unbound a
box and would like it to display the field [ident] plus some letters
following. The letters are dependant on some Yes/No fields. So if
[Ident] was 10 say and [T] = yes and [M] = yes then I am trying to
display 10TM. I have it working in a report under the OnFormat event
but I'm struggling to get it to do anything in a form. I am a novice
access/VB so if anyone could help please pitch your reply at that
level. The simple code I used in the report is...

'[ident] is the field, [identlbl] is the unbound box

If [T].Value = True Then
[identlbl].Value = [ident].Value & "T"
Else
[identlbl].Value = [ident].Value
End If
If [M].Value = True Then
[identlbl].Value = [identlbl].Value & "M"
Else
[identlbl].Value = [identlbl].Value
End If

All the relevant fields are on the subform with visible = false

I have tried all the OnEvent*** that I could find for the unbound box
and the sub form but all it does is nothing or just crashes.

Hope the above makes sense!

Any help would be appreciated


.......>Kieran
 
If all of the controls are on the subform then you might
try this:

in the control source for the unbound text box identlbl
enter the following:

=[ident].value & iif([t].value,"T","") & iif
([m].value,"M","")

If the unbound text box identlbl is on the main form and
the other controls are on the subform, then you would
want to precede each of the control names ([ident], [t],
[m]) with the following sintax:

[subformcontrolname].form!

so the statement would then start out:

=[subformcontrolname].form![ident].value & ....

Hope this helps and was what you were looking for.

-dc
 
Back
Top