farmerscott
Well-known Member
- Joined
- Jan 26, 2013
- Messages
- 824
- Office Version
- 365
- Platform
- Windows
Hi Everybody,
I am trying to create a form (called frmTime) that makes entering time a lot easier into a control.
On the form I have 3 unbound combo boxes. These being- Hour, Minutes and AM/PM. Each of these combo boxes has a value list (typed in by me, and not based on a table, etc).
On the form I also have a button to close the form. Once the form is closed the 3 values are to be concatenated to create a time value eg 6:30PM. The VBA code (I have so far) with this event is as follows (and is in the VBA editor associated with the form)-
My questions are-
1. Have I the correct change event for my needs?
2. Why does the line
give a compile error (highlighting frmTime)?
3. How do I get the values from the combo boxes?
errors saying it does not have the focus.
thanks
FarmerScott
I am trying to create a form (called frmTime) that makes entering time a lot easier into a control.
On the form I have 3 unbound combo boxes. These being- Hour, Minutes and AM/PM. Each of these combo boxes has a value list (typed in by me, and not based on a table, etc).
On the form I also have a button to close the form. Once the form is closed the 3 values are to be concatenated to create a time value eg 6:30PM. The VBA code (I have so far) with this event is as follows (and is in the VBA editor associated with the form)-
Code:
Private Sub CloseForm_Click()
Dim Hour As String
Dim frmTime As Form
'DoCmd.Close acForm, Me.frmTime
'Hour = Me.Combo8.Text
DoCmd.Close
End Sub
My questions are-
1. Have I the correct change event for my needs?
2. Why does the line
Code:
DoCmd.Close acForm, Me.[COLOR=#0000ff]frmTime[/COLOR]
3. How do I get the values from the combo boxes?
Code:
'Hour = Me.Combo8.Text
thanks
FarmerScott
Last edited: