diff --git a/src/sbbs3/ctrl/CodeInputFormUnit.cpp b/src/sbbs3/ctrl/CodeInputFormUnit.cpp
index 3034be502a0ac6af62bcb71de3d8be35a1e897ac..1f462ef4f44be299d4943e0931daf640e411a53b 100644
--- a/src/sbbs3/ctrl/CodeInputFormUnit.cpp
+++ b/src/sbbs3/ctrl/CodeInputFormUnit.cpp
@@ -49,7 +49,10 @@ __fastcall TCodeInputForm::TCodeInputForm(TComponent* AOwner)
 //---------------------------------------------------------------------
 void __fastcall TCodeInputForm::FormShow(TObject *Sender)
 {
-	ActiveControl=ComboBox;	
+	if(Edit->Visible)
+    	ActiveControl=Edit;
+    else
+		ActiveControl=ComboBox;
 }
 //---------------------------------------------------------------------------
 
diff --git a/src/sbbs3/ctrl/CodeInputFormUnit.h b/src/sbbs3/ctrl/CodeInputFormUnit.h
index 44fc7b61e78af5423572d913c43b0e9234235b60..bc3473ff138b69564f269c7f7093ac4566c56e04 100644
--- a/src/sbbs3/ctrl/CodeInputFormUnit.h
+++ b/src/sbbs3/ctrl/CodeInputFormUnit.h
@@ -56,6 +56,7 @@ __published:
 	TBevel *Bevel1;
 	TLabel *Label;
     TComboBox *ComboBox;
+	TEdit *Edit;
 	void __fastcall FormShow(TObject *Sender);
 private:
 public: