Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programatically Advancing Records in Continuous Form

Status
Not open for further replies.

gregarican

IS-IT--Management
Jan 31, 2002
469
0
0
US
I have an Access Form I'm using for an employee performance survey. Each employee is rated in 11 categories on a rating scale from 1-9. Rather than have each employee come up per category on a single form (equaling 11 forms per each employee rated!) I have changed the form to be continuous so the form displays all 11 categories being scored for each employee. I have disabled scrolling and other window modifications to keep the form pretty stationary. The form advance button is something I am manually coding.

I've been able to get around the unbound option group used for scoring by posting the results to a temp table. That's not a problem. The problem is when I try to advance exactly 11 records so that the previous employee goes off the continuous form and the next one comes up with their 11 records.

Declaring a PageCounter variable at the start of the form's code here's how I tried it:

PageCounter = PageCounter + 1

' Post the scoring from the temp table for the real responses

CurrentDb.Execute "INSERT INTO dbo_TblResponses SELECT * FROM TblDummy"
DoCmd.SetWarnings (WarningsOff)

' Flush the temp table for the next employee being scored

CurrentDb.Execute "delete from TblDummy"

' Try to advance to the next 11 set of categories to be scored

DoCmd.GoToRecord , , acGoTo, (PageCounter * 12)
Me.Refresh

The first form advances just down a single record so that record 12 is at the bottom of the form (rather than at the top). Subsequent advances are 12 records forward but now the count is off one so the pagination is all messed up.

Any ideas or suggestions?
 
THe following will simulate a page down/up response. You can add the pertinent line of code directly to a click event, or create a module. But I am not sure this will get you were you want to go.

Overall I am not sure why you are in the straights you are. Why would you need 11 forms/subforms for 11 option groups?

One form in single view that allows the user the move through the recordset on an employee by employee basis. Add the 11 option groups.

More info might be helpful.

Cheers, Bill
 
The 11 option groups are the ratings for all 11 categories. I want to display all 11 categories on the screen at once. If I can't do so and navigate reliably with a continuous form then I guess I will have to list all 11 categories with a single form through some self-join of the categories table?
 
Hi

Maybe you should just try making the result of each category an extra field in a table, so

Categories Table
----------------

EmployeeID
Category1
Category2
...
Category11

Am I on the right path?
Mr Big
 
Actually I figured this one out using a different angle. I have the primary form being the employee, which advances 1 record at a time. The categories being scored appear as a continuous subform which stays on the screen each primary form record advance. I just placed option groups to the side of the subform on the main form for each scoring category.

Sometimes I box myself into a corner and can't see other ways around things. Especially in terms of programming stuff. Thanks anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top