0

Why am I getting this error during design time?

Error Number 5: Key cannot be null

If Me.Visible = True Then
            If RetrieveSubjectsAndSection(Username, Subject) = True Then
                InsertSubjectsAndSection(Username,Subject)
            End If
        End If

RetrieveSubjectsAndSection function checks if record exist. The code is written inside a Usercontrol. Also I have not ran the program yet.


Everytime I move the Usercontrol on the form, the error pops up. As if it is trying to connect.

Edited by yorro: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by yorro
0

I found the solution, thanks snake.

If Me.DesignMode = False then
'control/form is in Runtime
end if
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.