I've got a button on a form that runs the following code block:
It works fine. The form this code is from, is linked to a table, called BrokerData, as the form's record source..
THE PROBLEM: I'd like to move this code from the click event of a button on the form, to a module not associated with the form or directly associated with the BrokerData table. Understand? If so, please help! Thanks!
-Jeremy
Code:
Dim ty As Integer
Dim tp As Integer
Dim ny As Integer
Dim np As Integer
Dim rs As Recordset
Set rs = Me.RecordsetClone
rs.MoveLast
ty = rs("Year")
tp = rs("Period")
Call GetNextPeriod(ty, tp, ny, np)
rs.AddNew
rs("Year") = ny
rs("Period") = np
rs.Update
rs.Bookmark = rs.LastModified
Me.Bookmark = rs.Bookmark
rs.Close
THE PROBLEM: I'd like to move this code from the click event of a button on the form, to a module not associated with the form or directly associated with the BrokerData table. Understand? If so, please help! Thanks!
-Jeremy