gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
I have this code someone helped me with. Where it places a value in PIDNumber (Me.PIDNumber=) I also want this same value to be placed on another table called TableRFPMgrDescription in a field named PID.
I dont know how to add the additional code
I tried Me.[TableRFPMgrDescription].PID= Me.ProposalIdentifier & padded & [RevisionId] & "-" & Me.ProgramLis ... and know that's not correct.
I dont know how to add the additional code
I tried Me.[TableRFPMgrDescription].PID= Me.ProposalIdentifier & padded & [RevisionId] & "-" & Me.ProgramLis ... and know that's not correct.
Code:
Private Sub Concant()
On Error GoTo errline
Dim padded As String
Select Case 5 - Len(CStr(PID_SequenceID))
Case 4
padded = "0000" & CStr(PID_SequenceID)
Case 3
padded = "000" & CStr(PID_SequenceID)
Case 2
padded = "00" & CStr(PID_SequenceID)
Case 1
padded = "0" & CStr(PID_SequenceID)
Case Else
End Select
Me.PIDNumber = Me.ProposalIdentifier & padded & [RevisionId] & "-" & Me.ProgramListID.Column(2) & "-" & Me.JobTypeListID.Column(2) & "-" & Me.YearIdGenerated & Me.MonthIdGenerated
exitline:
Exit Sub
errline:
Select Case Err.Number
Case Else
MsgBox "There was an error in the program. Please notify database administrator of the following error: Error Number: " & Err.Number & " " & Err.Description, vbCritical, "Please write this error down and note what you were doing at the time."
GoTo exitline
Resume Next
End Select
End Sub