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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form? - gettings information from records ahead and behind current

Status
Not open for further replies.

adamcbest

MIS
Feb 6, 2006
38
US
i have a form that displays an employee name of the recordsource bound to the form. is there a way either with expressions or vba code to pull the employee name form the record that is one, two ahead of the current record and one, two behind the current record. basically so i can see the employee i'm viewing, plus what is behind, and what is upcoming. anyway possible.

thought about somehting like currentrecord-1 , +1 etc, but that just creates interger value, not an actual record position.

any thoughts
 

How about using a continuous form?
You could set your margins so only 3 display at any given time.


Randy
 
i have time sheets for employees. that show there time for the day and all their times for a pay period. the form is rather large. I want to have nav buttons at the bottom that shows the current employee i'm on plus the ones ahead and behind. probably i will forget this idea and simply add a dropdown that has employee id and name that runs a requery after update. the way i was going to go didn't show three whole records. it showed just the names of the upcoming and previous employees and only the data for the current
 
You could the forms recordsetclone object

Dim rec as DAO.Recordset

Set rec = Me.RecordsetClone

rec.Bookmark = Me.Bookmark

rec.MovePrevious

strNotice = rec!txtName
rec.MoveNext
strNotice = strNotice & ", " & rec!txtName

something like that,
you want to check for EOF & BOF etc...
 
cool.. didn't know about recordsetclone object. i'll give that a shot. thanks man
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top