After reviewing the code posted in your last question, you can do something like this:
Dim lCommand As SqlCommand
lCommand = New SqlCommand(“Select data from table where data = “”" & UserID & “”"”, conNCIGFDNN)
If lCommand.ExecuteScalar Is Nothing Then
Insert() ‘call your insert code
Update() ‘call your update code
Catch lEx As Exception
‘handle your error
lCommand = Nothing ‘Clean up
Basically, check the database for an existing record matching you criteria. If it exists call you update code otherwise call you insert code.
The Try-Catch-Finally exception handling is a good thing to get in the habit of doing early on, as it will allow you to control the stability of the application.
I hope this helps.