B
buzzmcduffie
I need a field on my form that will autofill after a combo box (cbxCompany)
updates. It must look at other fields on the record and return the value,
[Goal], from a table (tblMailCodeTasks).
Fields on Table (tblMailCodeTasks):
TaskID
TaskCategory
MailCode
DisabilityIndicator
State
Goal
Active
VolumeCode
Fields on form: (frmManualTasksDataEntry)
cbxMailCodeTask
cbxState
cbxDisabilityIndicator
cbxVolumeCode
Goal
My code isn't working. What am I doing wrong?
Private Sub cbxCompany_AfterUpdate()
Me![Goal] = DLookup("[Goal]", "tblMailCodeTasks",
"[MailCode]=Forms![frmManualTasksDataEntry]![cbxMailCodeTask]" &
"[State]=Forms![frmManualTasksDataEntry]![cbxState]" &
"[DisabilityIndicator]=Forms![frmManualTasksDataEntry]![cbxDisabilityIndicator]" & "[VolumeCode] = Forms![frmManualTasksDataEntry]![cbxVolumeCode]")
End Sub
many thanks for any help!
updates. It must look at other fields on the record and return the value,
[Goal], from a table (tblMailCodeTasks).
Fields on Table (tblMailCodeTasks):
TaskID
TaskCategory
MailCode
DisabilityIndicator
State
Goal
Active
VolumeCode
Fields on form: (frmManualTasksDataEntry)
cbxMailCodeTask
cbxState
cbxDisabilityIndicator
cbxVolumeCode
Goal
My code isn't working. What am I doing wrong?
Private Sub cbxCompany_AfterUpdate()
Me![Goal] = DLookup("[Goal]", "tblMailCodeTasks",
"[MailCode]=Forms![frmManualTasksDataEntry]![cbxMailCodeTask]" &
"[State]=Forms![frmManualTasksDataEntry]![cbxState]" &
"[DisabilityIndicator]=Forms![frmManualTasksDataEntry]![cbxDisabilityIndicator]" & "[VolumeCode] = Forms![frmManualTasksDataEntry]![cbxVolumeCode]")
End Sub
many thanks for any help!