I have changed the code to appear as below:
[CODE=vb]
Private Sub OK_onclick()
Dim i
For i = CDate(Me!fldTra velDate) To CDate(Me!fldEnd Date)
If Not Isnull(Me!fldTr avelDate) And Not Isnull(Me!fldEn dDate) Then
DoCmd.RunSQL "INSERT INTO tblTravel(fldNa me,fldTravelDat e,fldEventName, fldLo cationCity,fldL ocationState) VALUES ('" + Me!fldName + "',"...
User Profile
Collapse
-
Sorry, I have been playing around with this further. The original code was copied and altered from an old post regarding this subject. I am new with working in VBA, and am struggling to fix according to the suggestions mentioned. I wonder if you can help guide me through this.Leave a comment:
-
Multiple Records Based On A Date Range
Hello:
I am trying to create multiple records in a table named tblTravel based on the input of a date range in two form controls. The inputs for the form are LastName, TravelDate, EndDate, Event, LocationCity, and LocationState. Everything works perfectly, except for the fact that the dates do not correctly enter into the table. For example, if I enter a date range of March 3, 2008 - March 5, 2008 and click OK, 3 records are generated....
No activity results to display
Show More
Leave a comment: