Giulio Benvenuti
asked on
if it is selected then ...
Hello. This is the code i would like use for access, but it doesnt work. Whats wrong?
Private Sub txtDataProssimaUdienza_LostFocus()
If litCalendario01 is selected Then
litCalendario01.Visible = True
Else
litCalendario01.Visible = False
End If
End Sub
My idea is to hide litCalendario01 if it's not selected
What is litCalendario01? A Control, which type of control exactly (button, checkbox, ...)? Please explain further.
ASKER
it's a button
In that case what "is selected" represent for you? You could use multiple button events:On Click, On Got Focus, ... it truly depends what you want to happen and when. Please explain the user experience you are trying to achieve here.
I don't understand your code as you seem to be hiding the control if it is 'selected'?
I don't understand your code as you seem to be hiding the control if it is 'selected'?
ASKER
there are a txtbox i called "txtDataProssimaUdienza" (its a date type, but i disabled the calendar because i needed to disable Saturday and Sunday) and a button i called "litCalendario01" (the calendar connected to txtDataProssimaUdienza).
litCalendar01 isn't visible untill i get focus on txtDataProssima. When i lose focus on txtDataProssimaUdienza litCalendar01 isn't visible, but i can't click on it to open the calendar.
This is the code for txtDataProssimaUdienza
litCalendar01 isn't visible untill i get focus on txtDataProssima. When i lose focus on txtDataProssimaUdienza litCalendar01 isn't visible, but i can't click on it to open the calendar.
This is the code for txtDataProssimaUdienza
Private Sub txtDataProssimaUdienza_GotFocus()
litCalendario01.Visible = True
End Sub
Private Sub txtDataProssimaUdienza_LostFocus()
If litCalendario01 Then
litCalendario01.Visible = True
Else
litCalendario01.Visible = False
End If
End Sub
and this is the code for litCalendar01Private Sub litCalendario01_Click()
Dim strFrmName As String
strFrmName = "DatePickerCalendar"
DoCmd.OpenForm strFrmName
With Forms(strFrmName)
Set .prpCtrlInitialDate = Me.txtDataProssimaUdienza
.fSetUp
.Caption = "Prossima Udienza"
End With
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.