I have an array set up to receive the names of forms when they open. The form name is sent as a Form not a String therefore when I run my code I cannot check for whether the field is empty in the normal way (ie. array(1) = "") as the "" are only usable with strings!

Dim Forms(24) As Form
Dim i As Integer
Dim Free As Integer = -1

Do
  If Forms(i) =  Then
    Free = CInt(i)
  End If
Loop Until Free <> -1

I only need a solution to do the same as array(1)="" but for windows forms.

Thanks for the help!

Recommended Answers

If Forms(i) Is Nothing Then
Jump to Post

All 2 Replies

If Forms(i) Is Nothing Then

Works perfectly, as usual with this brilliant forum!

Thanks for the help, it's really boosting my along with my computing coursework as waiting for tutors to reply is lonnnggg... :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.