I'm suddenly having a major problem trying to switch between rows in a continuous form in Access 2007. The form represents a timesheet and has a row for each activity that an employee may work on. There are 14 columns on the form for the days in the pay period, and each day is a text box, basically simulating a spreadsheet. So a row is a record in my source table. If my cursor is in day1, and I click another row, it moves the cursor to the new cell properly. If my cursor is in any other cell in the row, I can move within that row, but if I click another row, nothing happens. So everything is fine in day1, but not the rest, even though all the properties are the same.
I assumed this was connected, but it may not be, judging by the mouse not changing cells correctly. My users want to be able to use the up and down arrow keys to move between activities, so I'm using some borrowed code in each of the 14 text boxes:
Dim LastRec As Long
LastRec = Me.Recordset.RecordCount
If Shift = 0 Then
If KeyCode = vbKeyUp Then
If Me.CurrentRecord > 1 Then Me.Recordset.MovePrevious
KeyCode = 0
ElseIf KeyCode = vbKeyDown Then
If Me.CurrentRecord < LastRec Then Me.Recordset.MoveNext
KeyCode = 0
End If
End If
This was working fine up until today, and I don't know what's changed. I compared everything to a backup version and found nothing different. If I step through the code, the RecordSet.AbsolutePosition is changing, but the CurrentRecord is remaining the same, and the cursor onscreen is remaining in the same box. So after pressing the up arrow several times depending on where I started in the sheet, I get an error 3021 - No current record. The underlying RecordSet is changing position, but it's not showing on the form.
This is my first Access project, so I may be missing something simple. I would appreciate it immensely if anyone could shed some light on this for me.
Thanks,
Chip
More info that may not matter:
Table - EmployeeHours
Fields - EmployeeNumber*, PayPeriod*, ProjectNumber*, ActivityNumber*, ActivityTitle*, HoursType*, Day1, Day2, Day3, Day4, Day5, Day6, Day7, Day8, Day9, Day10, Day11, Day12, Day13, Day14, Rate, TotalHours, DollarAmount, Status
* - primary key
This continuous form is a subform on another form, and has enabled=false until a button is clicked. The source for the subform is set when the parent form opens or when the user selects the payperiod from a dropdown.