Moving data between fileds

M

Maracay

Hi gurus,

I created a subform, the one like a Excel spread sheet, all the data is
presented in columns, there are 2 columns “Time fromâ€, and “Time toâ€, I need
to get the a period of time in hours and minutes, what I need is when I am
typing the data, and press enter for a new record I need the data in the
column “Time Toâ€, to be in the column “Time From†of the new record,
basically the column “Time From†is never typed, because the initial value is
taken from a Table and after the second record will be taken from the field
“Time to†from the previous record.

Any help would be appreciated
 
L

Linq Adams via AccessMonster.com

This will do it until you close the form or manually enter a different time:

Private Sub TimeTo_BeforeUpdate(Cancel As Integer)
If Not IsNull(Me.TimeTo.Value) Then
TimeFrom.DefaultValue = "#" & Me.TimeTo & "#"
End If
End Sub

Just replace TimeTo and TimeFrom with your actual names.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top