Code:
Option Compare Database
Option Explicit
Dim RawTime As String
Dim RawHour As String
Dim RawMinutes As String
Dim AMPM As String
Dim RealTime As Variant
Private Sub cmdOK_Click()
RawHour = Forms!frmRealTime!cboHour
RawMinutes = Forms!frmRealTime!cboMinutes
AMPM = Forms!frmRealTime!cboAMPM
RealTime = TimeValue(RawHour & ":" & RawMinutes & AMPM)
Debug.Print RealTime
End Sub
I created a Form that has three combo boxes
cboHour Row Source 1;2;3;4;5;6;7;8;9;10;11;12
cboMinutes Row Source 00;15;30;45
cboAMPM AM;PM
I want to create a function that will pass the Real Time value to a text box
example:
a text box named txtStartTime
and lets say the function name is fRealTime()
So that a user can for example place the statement below in the On_Click event
=fRealTime([txtStartDate])
Need some thoughts/ideas how to accomplish this
Newbie in search of knowledge