I can’t remember how to do what is being suggested to me “It is best that if your method is not returning any data its best to declare your function/method as void in this case in VB. as Sub.”
Now my Try Catch is coming up with an error "Warning 2 Function 'SaveUserActivity' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used."
' This function saves the SavePersonnel Public Shared Function SavePersonnel(ByVal Database As String, ByVal FirstName As String, ByVal LastName As String, ByVal PayRate As Integer, ByVal StartDate As DateTime, ByVal EndDate As DateTime) Try ' Add your comments here Dim conn As New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & Database & "") conn.Open() Dim command As OleDbCommand = conn.CreateCommand() Dim strSQL As String ' Add your comments here strSQL = "Insert into tblPersonnel (FirstName, LastName, PayRate, StartDate, EndDate) values ('" & _ FirstName & "', '" & LastName & "', " & PayRate & ", '" & StartDate & "', '" & EndDate & "')" ' Add your comments here command.CommandType = CommandType.Text command.CommandText = strSQL ' Add your comments here command.ExecuteNonQuery() ' Add your comments here conn.Close() SavePersonnel = True Catch ex As Exception SavePersonnel = False End Try ‘Saying to add void here, but I am confused’ End Function