Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6877835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:38:55+00:00 2026-05-27T04:38:55+00:00

Am getting: Structure cannot be indexed because it has no default property. What am

  • 0

Am getting: “Structure cannot be indexed because it has no default property”. What am I doing wrong?

With grid.Rows(10).Cells
    Dim note As New Note With {.ID = "Blah", _
                               .Date = "1/1/2011", _
                               .Message = "AAA", _
                               .Type = "ABC", _
                               .SubType = "DEF", _
                               .ReferenceKey = !SetRefNum.Value}
End With

And Note looks like:

Public Structure Note
    Public Property ID As String
    Public Property [Date] As Date
    Public Property Message As String

    Public Property Type As String
    Public Property SubType As String
    Public Property ReferenceKey As String
 End Structure
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:38:55+00:00Added an answer on May 27, 2026 at 4:38 am

    The problem is with !SetRefNum.Value. You use the ! operator to reference an index in a collection, usually a dictionary. The Note class requires a Default property to use this terminology.

    Class Note
        Public ReadOnly Default Property Item(Key As String) As String
            Get
                Return Settings(Key)
            End Get
        End Property
        Private Settings As New Dictionary(Of String, String)
    End Class
    

    So the term !SetRefNum.Value will translate to note.Item("SetRefNum.Value").

    I’m going to take a guess you’re after something completely different.

    See the Member Access Operators section of the page Special Characters in Code (Visual Basic) for more information.

    Edit: Ammended answer for ammended question.

    I suggest the following approach:

    With grid.Rows(10).Cells
        Dim ReferenceKey As String = !SetRefNum.Value
        Dim note As New Note With {.ID = "Blah", _
                                   .Date = "1/1/2011", _
                                   .Message = "AAA", _
                                   .Type = "ABC", _
                                   .SubType = "DEF", _
                                   .ReferenceKey = ReferenceKey}
    End With
    

    Somehow, I doubt that will work either. You might need something like:

    With grid.Rows(10).Cells
        Dim ReferenceKey As String = .Item(SetRefNum.Value)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting stuck conceptually on deciding an Exception-handling structure for my project. Suppose
I'm having a problem getting XCode to deal with a particular file structure that
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
I've been getting several errors: cannot add an entity with a key that is
I have a table with the following structure. I cannot seem to get the
Describe a data structure where: Any item is indexed by an integral value like
While trying to convert my structure to byte* : objNDSDriver.StartFn((byte*)objSTNDSFTPDriverInfo); I am getting the
I am getting the following error message which I cannot understand why its happening
I am getting the following error: Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'System.Collections.Generic.List'. An
gcc 4.4.4 c89 I am keep getting a Cannot dereference to incomplete type. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.