Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / April 2008

Tip: Looking for answers? Try searching our database.

Sorting records on a continous form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Williams - 02 Apr 2008 15:47 GMT
I have a continuous sub form, based on a table Actionlog that is used as an
Action Log. There are 4 controls
Action Log - text
Timedate - based on Time/Date field of same name
Log Date - =Format([TimeDate],"dd-mm-yy")
Log Time - =Format([TimeDate],"hh:nn AM/PM")

The Event procedures for the sub form are:
Private Sub Action_Log_AfterUpdate()
If Me.NewRecord Then
Me.TimeDate = Now
End If
End Sub

Private Sub Form_Current()
If Me.NewRecord Then
      Me.Action_Log.Locked = False
   Else
      Me.Action_Log.Locked = True
   End If
End Sub

As the user inputs new data into the ActionLog control the date and time is
automatically entered in Log Date and Log Time.

In nearly all the records the entries for Action Log are sorted in date/time
order. In a few records odd entries appear out of sequence. I've sorted the
table by the TimeDate field but that hasn't made any difference. As the
controls are calculated it can't be the user making an input error.
Can anyone suggest what might be going wrong?
Thanks
Tony
Steve Schapel - 03 Apr 2008 22:27 GMT
Tony,

First of all, I would suggest the Action_Log_AfterUpdate code can be
dispensed with, as you can simply set the Default Value of the TimeDate
control to:
Now()

I would suggest, instead of the form being based directly on the
Actionlog table, you could change the Record Source of the form to a
query like this:
SELECT * FROM Actionlog ORDER BY TimeDate

Signature

Steve Schapel, Microsoft Access MVP

> I have a continuous sub form, based on a table Actionlog that is used as an
> Action Log. There are 4 controls
[quoted text clipped - 28 lines]
> Thanks
> Tony
Tony Williams - 06 Apr 2008 09:39 GMT
Thanks Steve sorry for the delay in replying. Took your advice and used a
query, worked a treat.
Cheers
Tony
> Tony,
>
[quoted text clipped - 41 lines]
>> Thanks
>> Tony
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.