Ok, now that I'm beginning to enjoy myself, and having moved to MS Access 2010, I've found some things easier....but not all.
I have a Purchases form, with a Combo Box storing a Contact Code (CCode).
I want to display the Contact Name relating to the CCode in an Unbound Text Box (called CompanyName) and have this auto looked up when the value in the Combo box changes.
I worked through all the help and tried to use DLookup in a procedure After Updating the Combo Box. I have added the error I am getting below.
Private Sub Combo15_AfterUpdate ()
strFilter = "CCode = " & Me!CCode
Me!CompanyName = DLookup ("CCompany", "Contacts", strFilter)
End Sub
Returns this error in DeBug: strFilter = "CCode = COS001" (COS001 is a valid CCode)
I know I'm not far off, but something is messing this all up. Any help would be much appreciated as I'm working around this but it's niggling me.
I have a Purchases form, with a Combo Box storing a Contact Code (CCode).
I want to display the Contact Name relating to the CCode in an Unbound Text Box (called CompanyName) and have this auto looked up when the value in the Combo box changes.
I worked through all the help and tried to use DLookup in a procedure After Updating the Combo Box. I have added the error I am getting below.
Private Sub Combo15_AfterUpdate ()
strFilter = "CCode = " & Me!CCode
Me!CompanyName = DLookup ("CCompany", "Contacts", strFilter)
End Sub
Returns this error in DeBug: strFilter = "CCode = COS001" (COS001 is a valid CCode)
I know I'm not far off, but something is messing this all up. Any help would be much appreciated as I'm working around this but it's niggling me.