Hermie,
No you can't do it that way. Try this:
1. If I assume your textbox is called "txtMonth", then...
2. Set the textbox's BackStyle property to Transparent.
3. Add a Label control to the form, size it exactly the same as the
textbox.
4. Set the Label's Caption property to "Enter the month", and centre the
text.
5. Set the Label's BackColor to white.
6. Set the Label's ForeColor property to grey (12632256).
7. Set the Textbox's OnEnter property (the property, not the event
procedure) as follows:
=SetControlTransparency(1)
8. Set the Textbox's OnExit property (the property, not the event
procedure) as follows:
=SetControlTransparency(-1)
9. Place the Label exactly under the Textbox.
10. Add the following to a standard module:
Private Enum TransparencyEnum
trsNONE = -1 'Set the transparency according to content
trsNORMAL = 1 'Set the BackStyle to Normal (not
transparent)
trsTRANSPARENT = 0 'Set the BackStyle to transparent
End Enum
Private Function SetControlTransparency(lStyle As TransparencyEnum)
'Sets the specified control's BackStyle to Normal or
Transparent.
Select Case lStyle
Case trsNONE
'If the control has content, then make it opaque,
'otherwise make it transparent
If Len(Trim(Screen.ActiveControl)) = 0 Then
Screen.ActiveControl.BackStyle = trsTRANSPARENT
Else
Screen.ActiveControl.BackStyle = trsNORMAL
End If
Case trsNORMAL
'Make the control opaque
Screen.ActiveControl.BackStyle = trsNORMAL
Case trsTRANSPARENT
'Make the control transparent
Screen.ActiveControl.BackStyle = trsTRANSPARENT
End Select
End Function
11. Repeats Steps 2 to 9, for txtYear. It will access the same code as
txtMonth.
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
hermie said:
Hello
I have an unbound form with a bound graphic in the detail section. In the
pageheader I created an unbound textbox for enter the month and year but
does work. It only shows the textbox as #name?
Is it not possible to do this in an unbound form? The value of the textbox
is: [enter month and year]
Any help is welcome
Herman