The problem is in this line:
cmd.CommandText="update famlid set gebdatum='"&ConvertToSQLDate (gebdatum)&"'"
ConvertToSQLDate is called with an unassigned variable named gebdatum. If you can the option Tools - Check for unassigned variables it will throw an error.
At the point of calling this sub the program doesn't know that it is part of a query.
You will need to change your code to go over all the rows and call update for each row with the calculated value (or implement this function inside the query with the SQL functions).