0

Good evening,

I'm having a issue when opening up another form when clicking the button. Basically the form I'm trying to open when you click the button is not in the same folder of the main Form. When I go to either build or debug the app, I get the following message

1>C:\Programming\Folder\Exam\Exam\MainDev.vb(1192,9): error BC30451: 'ExamSets' is not declared. It may be inaccessible due to its protection level. ========== Build: 0 succeeded, 1 failed, 25 up-to-date, 0 skipped ==========

I've tried multiple times, looked on the site, and even removed declaring the variable frmESNew and typing ExamSets.frmExamSetsCreateTestingX.show()

Thank you,

Gerard

   Private Sub ButScreenTestCreate_ItemClick(sender As Object, e As ItemClickEventArgs) _
        Handles butScreenTestCreate.ItemClick

        If ExamSetCreating = True Then
            Exit Sub
        End If
        ExamSetCreating = True

        Dim frmESNew As New ExamSets.frmExamSetsCreateTestingX
        frmESNew.Show()


    End Sub

I've tried removing the Dim, and found no luck in that attempt

6
  • You mean, this Form is not in the same Project, or even the same Solution. Which is it? -- Anyway, you can add a Reference to a Project in the same Solution, or even in another Solution Commented Dec 1, 2022 at 23:18
  • Or do you mean this Form is simply declared in a different namespace? Commented Dec 1, 2022 at 23:28
  • So this snippet is located in my main project "EXAM", and the form I want open up is located in "ExamSets". I actually added the reference to my Exam project, and nothing was resolved. I'm getting back into programming after 15yrs so I'm basically a newbie Commented Dec 2, 2022 at 0:39
  • located doesn't mean anything. Do you have different Projects in the same Solution? Different Solutions? Or different namespaces? If you have different Projects, did you add a Reference of which Project to which Project? -- From what you're saying, it appears you want to present in Project A a class (Form here) created in Project B, but you've added a Reference to Project A in Project B instead of the other way around. If that's the case, remove the reference you have added before you create the correct one, otherwise you end up with circular dependencies that blow up the whole thing Commented Dec 2, 2022 at 0:50
  • Ok I totally understand cause I know the circular dependencies can mess stuff up. Commented Dec 2, 2022 at 1:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.