Display on form (1 Viewer)

racdata

Registered User.
Local time
Today, 11:03
Joined
Oct 30, 2002
Messages
74
Hi all
Quite busy these days but never too busy to visit this website.

I have a question.
I am busy create a "Logsheet" database. Where you enter all your trips done with your vehicle.
Trip;Date;Trip_From; Trip_To;Start_Km; End_KM;
I do have a textbox where get the Trip_distance.(End_Km-Start_Km)

Is it possible too display on the current form the previous page End_KM.
Previous Trip End_Km-123456 (Display from previous page)
Trip Start_Km-123456 End_KM-123466 Distance-10
Next Page End_Km-123466 (Display from previous page)
Trip Start_Km-123466 End_KM-123486 Distance-20

I tried to do this but it came out only in a mess..
 

SunWuKung

Registered User.
Local time
Today, 09:03
Joined
Jun 21, 2001
Messages
172
If I understand you correctly while you are working on one record you are trying to display data from a previous record as well on the form.

The only way I can imagine this is through code (though the big guys may have something more elegant).

On Load
Step1 - get the ID of the previous record
Presuming that the ID's are time-ranked but not necessarily continuous I would use:
SQLstring = Select Max (ID) As PrevID From .... Where ID<CurrentID
Set rst = cn.Execute(SQLstring)
PrevID=rst!PrevID

Step2 - get the data you need to the form
Select * From .... Where ID=PrevID
Set rst = cn.Execute(SQLstring)
Me.Whatever=rst!Whatever
 

racdata

Registered User.
Local time
Today, 11:03
Joined
Oct 30, 2002
Messages
74
?? Help!!

I can't get this working, Am I too stupit?
Is there an easier way or give me more detail help!

I do not know much about coding.

:D
 

azzy

New member
Local time
Today, 01:03
Joined
May 4, 2005
Messages
8
Distance Form

HI Racdata,

Checkout the attached .mdb file for you..

you can enhance the form as you want.

Thanks
 

Attachments

  • DISTANCE.zip
    16.2 KB · Views: 101

Users who are viewing this thread

Top Bottom