473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Stuck in a record on a continuous form

1,287 Expert 1GB
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.
Nov 10 '08 #1
2 3122
ChipR
1,287 Expert 1GB
I was looking at a backup, considering redoing all of todays work on it, and now I'm getting the same thing happening. But now if I'm in a day1 cell, and click another row, the text in day1 is selected, and if I click again, the cursor moves to that cell. Still can't figure out what is going on though.
Nov 10 '08 #2
ChipR
1,287 Expert 1GB
Well I forgot that I had some code to round the values for each of the text boxes.

Private Sub Day1__Exit(Cancel As Integer)
Day1 = Round(Day1 + 0.00001, 2)
End Sub

It seems that was somehow stopping me from exiting the cell, as it worked fine when I commented all those out.
Anyone know what even should I use to round in so that I won't get stuck in the cell?

Thanks,
Chip
Nov 10 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mark | last post by:
Hi there, I have a subform, set as a continuous form. When a user selects a particular record in that subform, how can I make that particular record stand out (color or font change, size, etc) from...
1
by: Richard Coutts | last post by:
I have a Continuous Form where each record has a button that activates another form that simplifies entering values into the record. The activated form has the equivalent of a "Done" button. I'd...
3
by: vulcaned | last post by:
Hi All, Hopefully I ask this correctly In Access97 I have a continuous form which is bound via a select statement in the record source. Lets say a user starts entering a new record on this...
3
by: Typehigh | last post by:
I am a good programmer, but this one stumps me! I have a form with a continuous subform. The continuous subform contains records of data and may reach a depth of 1000's of entities. I have...
1
by: jodyblau | last post by:
I have a form that is in Continuous form. In each record there is a button next to the a date box. When the button is pushed, the calendar control is set to visible (rather than in a seperate pop...
6
by: John | last post by:
Hi I need to block user from moving away from a record using any of First/Last/Prev/Next/New Record or any other way IF the record has not been saved, and displaying a message to the effect...
3
by: ApexData | last post by:
I am using a continuous form for display purposes. Above this form, a single record is displayed so that when the user presses my NewButton they can enter a NewRecord which gets added to the...
3
by: eighthman11 | last post by:
Using Access 2000. I have a continuous form which for simplicity sack has two fields Social Security Number and Last Name. In the header of the continuous form I have a textbox where you can...
5
by: eighthman11 | last post by:
Hi everyone: This is probably a pretty simple problem but it is driving me nuts. Using Access 2000. I have a continuous form which list several thousand inventory items. The user can enter a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.