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

Preceding record

Status
Not open for further replies.

007700

Programmer
Jan 24, 2005
20
NL
Hi there,

This is what I would like to do:
I have got a form displaying me information from a table. Bassed uppon that information I would also like to display the preceding record on the form.

For Example:
I a table with months when I select February, it must automatically look into the table for the preceding record (January) and display this onto the form.

I tried it with a subform, but I don't seem to be getting it to look 1 record back....

Any ideas ????

 
How are the months stored in the table ?

January, February, March...
1,2,3,4,5...
1/1/2005, 2/1/2005....
1/2005, 2/2005....

Will the year affect the results ?

John Borges
 
M_ID M_nr Name Begin_date End_date Nr_days
1 1 Jan 1-1-2005 30-1-2005 30
2 2 Feb 1-2-2005 28-2-2005 28
3 3 Mrt 1-3-2005 30-3-2005 30


This is how the table looks.
I was hoping to do something via subform's....but I can't seem to tackle it......

any help is greatly appreciated....
 
Some more info.

For exmple:

First I select from A combo: February
Then on my form it will display me alle the info for February.

What I want is that it will also display all the info for January....
 
Try:

SELECT *
FROM Table
WHERE ((Table.Begin_date=#1/1/2005#) Or (Table.Begin_date=DateAdd("m",-1,#1/1/2005#)));

John Borges
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top