nigelh
09-27-2001, 02:06 AM
I have a table which requires start date and end date.
The feeder form has combo boxes for Start Date i.e
day month year and the same for End Date.
How do I concatenate the dates and transfer them to the table & ensure the end date is later than the start date.
ACCESS 2000
[This message has been edited by nigelh (edited 09-27-2001).]
Travis
09-27-2001, 11:32 AM
If cDate(Me.[startMonth] & "/" & Me.[startDay] & "/" & Me.[startYear]) > cDate(Me.[EndMonth] & "/" & Me.[EndDay] & "/" & Me.[EndYear]) Then
'StartDate is Greater then EndDate
End If
nigelh
09-28-2001, 04:21 AM
Thanks Travis.
My main problem is writng the dates to the table, as the date combo boxes are not bound.
This is the code I am working on at the moment.
Private Sub Form_Close()
Dim dbsCurrent As DAO.Database
Dim rstDate As DAO.Recordset
Set dbsCurrent = CurrentDb()
Set rstDate = dbsCurrent.OpenRecordset("TblCustomerTests", dbOpenDynaset)
Dim FromDateDay As Integer
Dim FromDateMonth As Integer
Dim FromDateYear As Integer
Dim ToDateDay As Integer
Dim ToDateMonth As Integer
Dim ToDateYear As Integer
FromDateDay = Combo2.Value
rstDate.Edit
rstDate![From Date] = FromDateDay
rstDate.Update
End Sub
I haven't included the concatenation here, I just want to get some data in the table.
Combo2.value is the Start Date DAY combo box.
I'm probably on completely the wrong track, I'm using a manual as I have not used VB before.
Thanks for any help
What exactly are you trying to do, why are you seperating dates into individual components?
nigelh
09-28-2001, 05:45 AM
I thought it would be more user friendly, but didn't realise how programmer (novice) unfriendly it would be.
Sorry, one more thing; what event should I add this code to, so that the dates are updated once all fields in the form are complete and accepted?
[This message has been edited by nigelh (edited 09-28-2001).]
nigelh
10-03-2001, 03:07 AM
can anyone help with this?
Thanks in advance