You can file for relief under the bankruptcy code regardless of the status of the collection of the debt.  Upon filing, the Bk Court will issue the automatic stay which will stop the civil proceeding.  Assuming that the bankruptcy is granted, the case in the civil court would have to be dismissed and you would be discharged of liability.