BrandonM30
New member
- Local time
- Yesterday, 21:37
- Joined
- Sep 16, 2016
- Messages
- 9
Hi guys,
I have the following code to call Data from a table and insert it into a form.
Private Sub cmbSONumber_AfterUpdate()
Dim DB As Database
Dim rs As Recordset
Dim STR As String
Set DB = CurrentDb
STR = "SELECT * FROM [tblShippingLog] WHERE [ISF V3 SO] = '" & Me.cmbSONumber & "';"
Set rs = DB.OpenRecordset(STR)
If rs.EOF = False Then
Me.txtShippedBy = rs![Shipped By]
Me.txtProgram = rs![Program]
Me.txtSTSN = rs![ST Serial Number]
Me.txtS3Update = rs![S3 Done]
Me.txtDateCreated = rs![Date Created]
Me.txtDateRequired = rs![Date Required]
Me.txtShipmentDescription = rs![Shipment Description]
Me.txtShipmentNetworkID = rs![Network ID]
Me.txtDeliveryLocation = rs![Delivery Location]
Me.txtGovtTag = rs![Gov Tag]
Me.txtSecurityLevel = rs![CCI/COMSEC or Classified]
Me.txtODTNumber = rs![ODT#]
Me.txtCarrier = rs![Carrier]
Me.txtTrackingNumber = rs![Tracking Info]
Me.txtQTY = rs![Qty]
Me.txtPackageType = rs![Package Type]
Me.textDimensions = rs![Dimensions]
Me.txtWeight = rs![Total Weight]
Me.txtShippingCost = rs![Est# Cost]
Me.txtSTRemarks = rs![Comments]
Me.txtDateShipped = rs![Ship date]
Me.cmbStatus = rs![Status]
End If
rs.Close
End Sub
I would like to then update the fields in the form and inset the new values into the tables record that I chose Initially.
How would I go about doing that? Do I use an Update Query?
Thanks in advance for your help and assistance.
I have the following code to call Data from a table and insert it into a form.
Private Sub cmbSONumber_AfterUpdate()
Dim DB As Database
Dim rs As Recordset
Dim STR As String
Set DB = CurrentDb
STR = "SELECT * FROM [tblShippingLog] WHERE [ISF V3 SO] = '" & Me.cmbSONumber & "';"
Set rs = DB.OpenRecordset(STR)
If rs.EOF = False Then
Me.txtShippedBy = rs![Shipped By]
Me.txtProgram = rs![Program]
Me.txtSTSN = rs![ST Serial Number]
Me.txtS3Update = rs![S3 Done]
Me.txtDateCreated = rs![Date Created]
Me.txtDateRequired = rs![Date Required]
Me.txtShipmentDescription = rs![Shipment Description]
Me.txtShipmentNetworkID = rs![Network ID]
Me.txtDeliveryLocation = rs![Delivery Location]
Me.txtGovtTag = rs![Gov Tag]
Me.txtSecurityLevel = rs![CCI/COMSEC or Classified]
Me.txtODTNumber = rs![ODT#]
Me.txtCarrier = rs![Carrier]
Me.txtTrackingNumber = rs![Tracking Info]
Me.txtQTY = rs![Qty]
Me.txtPackageType = rs![Package Type]
Me.textDimensions = rs![Dimensions]
Me.txtWeight = rs![Total Weight]
Me.txtShippingCost = rs![Est# Cost]
Me.txtSTRemarks = rs![Comments]
Me.txtDateShipped = rs![Ship date]
Me.cmbStatus = rs![Status]
End If
rs.Close
End Sub
I would like to then update the fields in the form and inset the new values into the tables record that I chose Initially.
How would I go about doing that? Do I use an Update Query?
Thanks in advance for your help and assistance.