Firstly, I'm a very long way from getting published at the moment so this is purely academic. However, I've been wondering. If you do get an agent and the agent sells your work to a publisher, what happens when you want to write a sequel, or another unconnected book? Will the agent automatically take you on again or do you have to go through all the submitting thing again as though it's the first time? Also, if you're writing a continuous series (e.g. Harry Potter) will the agent agree at the start to take on all the series (written or unwritten) or just the first book? Thanks in advance for your help!
Once an agent has represented you, you will be able to contact him/her about future works. It isn't automatic, but if you have already had success and a good working relationship, you have a foundation to build on. Agents like that. It's good to know the publishing industry if you're going to try to market your work. But concentrate on writing one book of publishable quality. Talk about sequels and series can come later. Best of luck.
as noted above, if your first one sold well, the agent will be open to you submitting other mss... they may or may not still require a query before sending in the ms... that's up to what your representation agreement states... ...few, if any agents will take on a series... the first book must be a stand-alone and sell well before anyone will risk taking on sequels... ...as ed wisely counsels, you shouldn't be thinking 'series' or 'sequels' till you have a book out in the book stores that's selling like hotcakes...
Which means your first book has to be able to stand alone, as a novel in its own right, without requiring the rest of the series in order to make any sense. Otherwise it's incredibly unlikely that any agent would take it on.
Furthermore, your first book will probably seem amateurish by the time you are well into writing your second. If you write a sequel to one of your books, perhaps you should wait until you have accumulated some experience; enough experience to make an informed decision whether to go ahead with the sequel.