Endojoe
Registered User.
- Local time
- Today, 07:01
- Joined
- Apr 7, 2009
- Messages
- 20
I'm trying to use an If/Then statement to get a command button to create a new record with certain information carried over from an existing record, but just exactly what information is carried over is dependent upon the selection present in an Option Group...each half of the code works fine by itself, but when I put it into an If/Then (as below)...the button fails to function. (There are substantially more fields I'm actually carrying over, but it seemed redundant to have like 40 more lines in the code box)
So it's likely I'm missing something really simple, possibly even stupid, but I've looked at it over and over again and don't see why it shouldn't work...granted, I'm not particularly well versed in VB. Any suggestions would be wonderful. Thank you all in advance.
Code:
Private Sub cmd_copy_record_Click()
If Me.opt_Assy_SubAssy = 1 Then
Dim v1 As Variant
Dim v2 As Variant
Dim v3 As Variant
v1 = Me!txt_date.Value
v2 = Me!txt_TRACK_NUMBER_CERT.Value
v3 = Me!txt_CUSTOMER_NAME.Value
RunCommand acCmdRecordsGoToNew
Me!txt_date = v1
Me!txt_TRACK_NUMBER_CERT = v2
Me!txt_CUSTOMER_NAME = v3
ElseIf Me.opt_Assy_SubAssy = 2 Then
Dim v1 As Variant
Dim v2 As Variant
v1 = Me!txt_date.Value
v2 = Me!txt_TRACK_NUMBER_CERT.Value
RunCommand acCmdRecordsGoToNew
Me!txt_date = v1
Me!txt_TRACK_NUMBER_CERT = v2
End If
End Sub
So it's likely I'm missing something really simple, possibly even stupid, but I've looked at it over and over again and don't see why it shouldn't work...granted, I'm not particularly well versed in VB. Any suggestions would be wonderful. Thank you all in advance.