I have a form called frmClientTracking, within this form is subform called sfrmService.
The subform (datasheet view) consists of ServiceCd and ServiceNm, etc. ServiceCd is a pulldown list populated from another table via the row source control, when a certain number is selected, I want to populate the ServiceNm field with designated text from my VBA code.
Here is the code I have:
ServiceCd_OnClick()
Select case Forms!frmClientTracking!sfrmService.Form!ServiceCd
case 242
Forms!frmClientTracking!sfrmService.Form!ServiceNm = "No Activity"
case 252
Forms!frmClientTracking!sfrmService.Form!ServiceNm = "YMCA"
case 262
Forms!frmClientTracking!sfrmService.Form!ServiceNm = "MCO Medical Center"
'and so on
End Select
Get error saying cant find sfrmService in my expression. Is it possible to do this in datasheet view of a subform. It seems straight forword, but I cant seem to get it to work.
Any ideas would be a great help.
Thanks,
The subform (datasheet view) consists of ServiceCd and ServiceNm, etc. ServiceCd is a pulldown list populated from another table via the row source control, when a certain number is selected, I want to populate the ServiceNm field with designated text from my VBA code.
Here is the code I have:
ServiceCd_OnClick()
Select case Forms!frmClientTracking!sfrmService.Form!ServiceCd
case 242
Forms!frmClientTracking!sfrmService.Form!ServiceNm = "No Activity"
case 252
Forms!frmClientTracking!sfrmService.Form!ServiceNm = "YMCA"
case 262
Forms!frmClientTracking!sfrmService.Form!ServiceNm = "MCO Medical Center"
'and so on
End Select
Get error saying cant find sfrmService in my expression. Is it possible to do this in datasheet view of a subform. It seems straight forword, but I cant seem to get it to work.
Any ideas would be a great help.
Thanks,