M
MET
I am attempting to populate some of the fields when
adding data to my tables. Please bear with me, as I am a
complete novice at this. My first call was through this
subroutine. This part appears to be functioning properly.
Private Sub Race_Exit(Cancel As Integer)
Dim varTrack As String
If (IsNull([Track])) Then
varTrack = LastTrack()
End If
End Sub
Here comes my problem. I am wanting to access the current
form, which called the above subroutine, and display the
field [Track] from the last record of the table. This
data can repeat for a number of records, enough so that I
must make this a data item. The current table is
tblResults.
Private Function LastTrack() As String
Dim rst As Recordset
Dim LastRaceTrack As String
Set rst = CurrentDb.OpenRecordset("tblResults",
dbOpenDynaset)
rst.MoveLast
LastRaceTrack = Me!Track
LastTrack = LastRaceTrack
End Function
Thanks for taking a look at this.
adding data to my tables. Please bear with me, as I am a
complete novice at this. My first call was through this
subroutine. This part appears to be functioning properly.
Private Sub Race_Exit(Cancel As Integer)
Dim varTrack As String
If (IsNull([Track])) Then
varTrack = LastTrack()
End If
End Sub
Here comes my problem. I am wanting to access the current
form, which called the above subroutine, and display the
field [Track] from the last record of the table. This
data can repeat for a number of records, enough so that I
must make this a data item. The current table is
tblResults.
Private Function LastTrack() As String
Dim rst As Recordset
Dim LastRaceTrack As String
Set rst = CurrentDb.OpenRecordset("tblResults",
dbOpenDynaset)
rst.MoveLast
LastRaceTrack = Me!Track
LastTrack = LastRaceTrack
End Function
Thanks for taking a look at this.