D
durtywhytboy via AccessMonster.com
Hello;
I have searched the database here and have used some code I found to address
the following:
I have a form bound to a table. The primary key of the table is the field
[RCN]. I have a New Record button that I want the user to press, initiating a
new record with the previous value of [RCN] and incrementing by + 1. This is
not a autonumber field.
For example: Current Record Value = RCN-08-0001
Desired New Record Value = RCN-08-0002
The code behind the button click so far (which I can't get to work):
Private Sub newrecord_Click()
DoCmd.GoToRecord acDataForm, "frmFORM", acNewRec
Const cQuote = """" 'Thats two quotes
Me!RCN.DefaultValue = cQuote & Me!RCN.Value & cQuote
End Sub
Any help given is most aprreciated
dwb
I have searched the database here and have used some code I found to address
the following:
I have a form bound to a table. The primary key of the table is the field
[RCN]. I have a New Record button that I want the user to press, initiating a
new record with the previous value of [RCN] and incrementing by + 1. This is
not a autonumber field.
For example: Current Record Value = RCN-08-0001
Desired New Record Value = RCN-08-0002
The code behind the button click so far (which I can't get to work):
Private Sub newrecord_Click()
DoCmd.GoToRecord acDataForm, "frmFORM", acNewRec
Const cQuote = """" 'Thats two quotes
Me!RCN.DefaultValue = cQuote & Me!RCN.Value & cQuote
End Sub
Any help given is most aprreciated
dwb