Add to codes to place results in another Table

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,341
Office Version
  1. 365
Platform
  1. 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.

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
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You could use an append or update query to do this, depending on whether the record exists or not.
If not, use Append, else Update query.

HTH
 
Upvote 0

Forum statistics

Threads
1,215,335
Messages
6,124,326
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top