Hi
Can someone please explain why I need to have two different wording because I get the following error
Access of shared member, constant member, enum member or nested type through an instance; qualify expression will not be evaluated.
Private mEmployeeDetail As EmployeeDetail = Library.EmployeeDetail.NewEmployeeDetail
Protected mTaxDetail As TaxDetail = Library.TaxDetail.NewTaxDetail
Protected mAddressDetail As AddressDetail = AddressDetail.NewAddresDetail
Thanks for the help
Ellie
Ellie,
It isn't clear from your post when or where you are getting the error message.
This looks correct to me:
Protected mTaxDetail As TaxDetail = Library.TaxDetail.NewTaxDetail
You could get that message if you incorrectly coded it like this: (Note the use of mTaxDetail on the right side.)
Protected mTaxDetail As TaxDetail = mTaxDetail.NewTaxDetail
Joe
Access of shared member, constant member, enum member or nested type through an instance; qualify expression will not be evaluated.
Sorry for the confusion.
Private mEmployeeDetail As EmployeeDetail = Library.EmployeeDetail.NewEmployeeDetail
works but if I have
Private mEmployeeDetail As EmployeeDetail = EmployeeDetail.NewEmployeeDetail
then the error occurs. Yet
Protected mAddressDetail As AddressDetail = AddressDetail.NewAddresDetail
works
What is that all about ?
Are you calling this code in a class that contains a shared property called EmployeeDetail? If so, you should include Library. The reason for this is if you omit Library, the code:
Private mEmployeeDetail As EmployeeDetail = EmployeeDetail.NewEmployeeDetail
Really is (notice the Me.)
Private mEmployeeDetail As EmployeeDetail = Me.EmployeeDetail.NewEmployeeDetail.
It is incorrect
to call a shared property from an instance.
As a result, you will get this error.
Thanks so much, I had unintentionally done just that. I could find an explain in the help so I couldn't work out the problem
The property for the EmployeeDetail within the Employee Class had the same name as the child class EmployeeDetail.
Thanks, thanks thanks, it has driven me nuts off and on for ages but never found the problem
Ellie
Copyright (c) Marimer LLC