First off keep in mind that every time the page posts back everything is re-instantiated including the page itself. This means that your TextBox control is being created each time the page posts back. And since you are not using the New keyword you are getting the NullReferenceException.
I would suggest an alternative to the method you are attempting to use. Since you are only using one calendar control to populate three different textboxes, you need to know which button that is associated to each textbox initiated the Click event. Store the name of the button in a Session variable and then check that value in the SelectionChanged event of the calendar control.
To illustrate this, here is an example:
Here is the code for the page itself. 3 textboxes, 3 buttons, and 1 calendar control.
HTML
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtDate1" runat="server"></asp:TextBox>
<asp:Button ID="btnDate1" runat="server" Text="Date1" /><br />
<asp:TextBox ID="txtDate2" runat="server"></asp:TextBox>
<asp:Button ID="btnDate2" runat="server" Text="Date2" /><br />
<asp:TextBox ID="txtDate3" runat="server"></asp:TextBox>
<asp:Button ID="btnDate3" runat="server" Text="Date3" /><br />
<asp:Calendar ID="Calendar1" runat="server" Visible="false"></asp:Calendar>
</div>
</form>
</body>
</html>
Each button calls the same event. First create a button in the event and then cast the sender object to the correct type. The sender object will tell us which button called the event. Once we have the correct button, store the ID in a Session variable and then show the calendar.
CODE
Protected Sub btnDate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDate1.Click, btnDate2.Click, btnDate3.Click
'create a new button
Dim clickedButton As Button
'cast the sender to the correct type, a Button
clickedButton = CType(sender, Button)
'store the Button ID in a Session variable
Session("ButtonClicked") = clickedButton.ID
'show the calendar
Calendar1.Visible = True
End Sub
Now in the SelectionChanged event of the calendar get the value stored in the Session variable and use it to determine the logical path to follow and put the date in the correct textbox. Lastly, hide the calendar control again until the next button is clicked.
CODE
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
'verify that a Session variable is valid before attempting to use it
If Session("ButtonClicked") <> Nothing Then
'now check the session variable for the ID of the button
'this will indicate which textbox to put the date into
If Session("ButtonClicked").ToString().Equals("btnDate1") Then
txtDate1.Text = Calendar1.SelectedDate.ToString()
ElseIf Session("ButtonClicked").ToString().Equals("btnDate2") Then
txtDate2.Text = Calendar1.SelectedDate.ToString()
Else
txtDate3.Text = Calendar1.SelectedDate.ToString()
End If
End If
'hide the calendar
Calendar1.Visible = False
End Sub
I hope that helps explain a fairly simple method of accomplishing the task you desire.