I have 2 functions that need to work together.

1 function is to generate a chart number. The other function is to search via SQL to see if the chart number exists. if the chart number doesn't exist then i need function 2 to return a boolean value so function one can generate a new chart number...
example code:

Dim available As Boolean
Dim sql As String = Nothing

Dim tempChartnumber As String = TemporaryChart

Dim con As New OleDb.OleDbConnection
con.ConnectionString = conString
Dim ds As New DataSet
Dim da As New OleDb.OleDbDataAdapter
Dim dt As New DataTable

sql = "SELECT [Chart Number] FROM Demographics WHERE [Chart Number] ='" & tempChartnumber.ToUpper & "';"

da = New OleDb.OleDbDataAdapter(sql, con)

Catch ex As Exception
TextBox1.Text = ex.ToString

End Try

Return available

Now i know that i am probably using the incorrect sql statement, my main issue is that i dont know how return available back to the function.

Can someone Please help me. or give me an article or tell me if you need more info.. I dont even know if i'm going about the wrong direction

Help a NEWBIE out!!!