Randomblink
The Irreverent Reverend
- Local time
- Today, 08:47
- Joined
- Jul 23, 2001
- Messages
- 279
Ok.
I have a form.
The purpose of the form is to generate a new report.
The user opens the form.
Selects a Client and a Borrower.
The user presses a button that assigns the REPORT NUMBER.
The number is SUPPOSED to be based on the Primary Key for the table the form is based on?
However, for the life of me, I can't get the "Me.rpt_id" field to give me ANYTHING because I am in a brand new record...
What can I do?
The VBA I use for the "ASSIGN REPORT NUMBER" button is:
Private Sub btn_AssMTSNum_Click()
Dim curDate As Variant, curYear As Variant
Dim Assign As String
curDate = Date ' First we grab the current date
curYear = Year(curDate) ' Then we grab the Year OUT of the current date
Assign = Me.Name
Assign = Me.rpt_ID & "." & Right(curYear, 2)
Me.mts_file_number.Value = Assign
Select Case Me.Dirty
Case True:
DoCmd.RunCommand acCmdSaveRecord
chkCurForm Me
Case Else:
End Select
End Sub
Help me if you can... I am just lost!
I have a form.
The purpose of the form is to generate a new report.
The user opens the form.
Selects a Client and a Borrower.
The user presses a button that assigns the REPORT NUMBER.
The number is SUPPOSED to be based on the Primary Key for the table the form is based on?
However, for the life of me, I can't get the "Me.rpt_id" field to give me ANYTHING because I am in a brand new record...
What can I do?
The VBA I use for the "ASSIGN REPORT NUMBER" button is:
Private Sub btn_AssMTSNum_Click()
Dim curDate As Variant, curYear As Variant
Dim Assign As String
curDate = Date ' First we grab the current date
curYear = Year(curDate) ' Then we grab the Year OUT of the current date
Assign = Me.Name
Assign = Me.rpt_ID & "." & Right(curYear, 2)
Me.mts_file_number.Value = Assign
Select Case Me.Dirty
Case True:
DoCmd.RunCommand acCmdSaveRecord
chkCurForm Me
Case Else:
End Select
End Sub
Help me if you can... I am just lost!