Hi guys,

I was hoping someone could explain to me how I would go about grabbing a pointer/reference to my variable 'textName' contained within the Reports class, (some code omitted to try to simplify the scenario)

class Reports : public wxPanel 
	void AddStudent(wxCommandEvent & event);
	wxTextCtrl *textName; // declare variable
Reports::Reports(wxPanel * parent)
       : wxPanel(parent, wxID_ANY, wxPoint(-1, -1), wxSize(500, 500))

	  wxTextCtrl *textName = new wxTextCtrl(this, wxID_AddStudent, wxT(""), wxPoint(65, 65));


void Reports::AddStudent(wxCommandEvent & WXUNUSED(event))
	// The following breaks the code, I want to grab textName

	/* *************************
	If I re-create textName then access (as shown in the following 
        commented code) then it works fine but I can't
        work out how to create a pointer/reference to the
        previous textName rather than having to re-create one!

wxTextCtrl *textName = new wxTextCtrl(this,wxID_AddStudent, wxT("Another button..."), wxPoint(65, 95));