rbbrmtstherd
New member
- Local time
- Today, 18:22
- Joined
- Aug 15, 2012
- Messages
- 1
Good morning,
This is my first post, so please bear with me if I am not posting in the correct format. I am fairly new to VBA, but have been using/learning it in my current job to create some reporting/tracking tools in access. I have been using a lot of other peoples' threads on here to figure out much of what I need to do, but I am stuck right now.
I am having an issue right now where I have a form ("FrmTrlrInfo") and on it I have two fields ("Carrier" and "SCAC"), along with around 10 other fields. These are all tied to TblData as their control source. I have another table "TblCarrierList" that has a list of all available Carrier/SCAC combinations (with the fields "Carrier" and "SCAC". In FrmTrlrInfo, Carrier is a dropdown list that uses the available options in TblCarrierList. What I want to happen, is that after the Carrier is selected on the form, SCAC (on the form) is updated with the corresponding SCAC value from TblCarrierList.
I tried using a query to update the table, but it would not update the current record I was working on.
Code:
Private Sub Carrier_AfterUpdate()
docmd.OpenQuery "QryUpdateSCAC"
Me.Refresh
End Sub
Any thoughts or advice would be greatly appreciated.
This is my first post, so please bear with me if I am not posting in the correct format. I am fairly new to VBA, but have been using/learning it in my current job to create some reporting/tracking tools in access. I have been using a lot of other peoples' threads on here to figure out much of what I need to do, but I am stuck right now.
I am having an issue right now where I have a form ("FrmTrlrInfo") and on it I have two fields ("Carrier" and "SCAC"), along with around 10 other fields. These are all tied to TblData as their control source. I have another table "TblCarrierList" that has a list of all available Carrier/SCAC combinations (with the fields "Carrier" and "SCAC". In FrmTrlrInfo, Carrier is a dropdown list that uses the available options in TblCarrierList. What I want to happen, is that after the Carrier is selected on the form, SCAC (on the form) is updated with the corresponding SCAC value from TblCarrierList.
I tried using a query to update the table, but it would not update the current record I was working on.
Code:
Private Sub Carrier_AfterUpdate()
docmd.OpenQuery "QryUpdateSCAC"
Me.Refresh
End Sub
Any thoughts or advice would be greatly appreciated.