Index: trunk/desktop/mainWindow.rbfrm
===================================================================
--- trunk/desktop/mainWindow.rbfrm	(revision 19)
+++ trunk/desktop/mainWindow.rbfrm	(revision 21)
@@ -138,5 +138,5 @@
       Top             =   32
       Underline       =   ""
-      Value           =   3
+      Value           =   1
       Visible         =   True
       Width           =   637
@@ -3226,4 +3226,10 @@
 		Sub Action()
 		  ICSSerialPort1.deleteProfile(PopupMenu_Profile.Text)
+		  
+		  PopupMenu_Profile.RemoveRow(PopupMenu_Profile.ListIndex)
+		  
+		  //Make sure to hide the save and delete profile buttons since no profile will be selected after this has been deleted
+		  PushButton_SaveProfile.Visible = False
+		  PushButton_Delete.Visible = False
 		End Sub
 	#tag EndEvent
Index: trunk/desktop/ICSSerialPort.rbbas
===================================================================
--- trunk/desktop/ICSSerialPort.rbbas	(revision 20)
+++ trunk/desktop/ICSSerialPort.rbbas	(revision 21)
@@ -328,19 +328,27 @@
 	#tag Method, Flags = &h0
 		Sub saveProfile(theName as String)
-		  dim rs as RecordSet
-		  dim status as Boolean
-		  
-		  //Find a record
-		  rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'")
-		  
-		  //Make sure we got a record
-		  if rs <> nil then
-		    //delete the record before saving
-		    deleteProfile(theName)
+		  if theName <> "" then
+		    
+		    dim rs as RecordSet
+		    dim status as Boolean
+		    
+		    //Find a record
+		    rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'")
+		    
+		    //Make sure we got a record
+		    if rs <> nil then
+		      //delete the record before saving
+		      deleteProfile(theName)
+		    end if
+		    
+		    rs.Close
+		    
+		    status = createProfile(theName)
+		    
+		  else
+		    
+		    MsgBox "Please select a profile to modify"
+		    
 		  end if
-		  
-		  rs.Close
-		  
-		  status = createProfile(theName)
 		End Sub
 	#tag EndMethod
