Maybe what I am trying to do is impossible. I am trying to pass a form value to a VB shared function. I can't pass the form value as a parameter to the function because I am using a 3rd party component. Here is some code to help to what exactly is going on:<BR><BR><Cambro.Web.DbCombo.ResultsMethodAttribute(tru e)> _<BR> Public Shared Function SearchCustomer(sqlQuery as String, top As Integer) As Object<BR> <BR> Dim mydataset as DataSet = New DataSet()<BR> Dim MyConnection As oledbConnection <BR> <BR> 'My connection is hidden <BR> Dim adapter As New OleDbDataAdapter()<BR> adapter.SelectCommand = new OleDbCommand("SELECT ID DBComboValue,NAME DBComboText FROM CUSTOMER_MASTER WHERE TERMNUM = " & termnum.text & " AND NAME LIKE '" & UCase(sqlQuery) & "%'",MyConnection)<BR> <BR> MyConnection.Open()<BR> <BR> adapter.Fill(mydataset,"customers")<BR> <BR> MyConnection.Close()<BR> return mydataset<BR> End Function<BR><BR>Form:<BR><BR><td>Terminal Number:</td><BR><td><asp:literal id="termnum" runat="server" /></td><BR><td>Contractor Code</td><BR><td><DbCombo:Combo Runat="server" ID="contractorcode" ShowUpLevelHelpButton="false" ShowDownLevelHelpButton="false" ShowRevertButton="false" ShowClearButton="false" ServerMethod="SearchContractor" /></td><BR></tr><BR><BR>AS you can see I am trying to use a form value inside the function. I tried putting:<BR><BR>Protected Shared WithEvents termnum As System.Web.UI.WebControls.TextBox <BR><BR>but it throws an error saying it already exists.<BR><BR>Matt<BR>try request.form("termnum") instead of termnum.textIT still returns the same evil error message:<BR><BR>Compiler Error Message: BC30369: Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.<BR><BR>MattI suppose it would of helped had I actually read your code better, but what I see is that you are not pulling the value from a textbox but from a literal control. Your form is setup all wrong. try this<BR><BR>Form: <BR><form runat="Server"><BR><td>Terminal Number:</td> <BR><td><asp:textbox id="termnum" runat="server" /></td> <BR><td>Contractor Code</td> <BR><td><DbCombo:Combo Runat="server" ID="contractorcode" ShowUpLevelHelpButton="false" ShowDownLevelHelpButton="false" ShowRevertButton="false" ShowClearButton="false" ServerMethod="SearchContractor" /></td> <BR></tr> <BR><BR></form><BR><BR><BR>I don't know what your doing with that dbcombo:combo control and cant say if it will work. Notice I changed your literal to a textbox and placed form tags around your tableI already have the form tags in place or the page would not not run and there are more fields than what is listed up above. I only was showing the fields and vb code that I was using not the whole program. There is nothing strucurally wrong with my code except the termnum.text or the request.form method you suggested. The dbcombo thing is the 3rd party component I am connecting to for the *shared function* that is causing me grief. *shared functions* are different than regular functions. The code up above would have worked if it was not a *shared function*.<BR><BR>MattOk, I guess I just got confused and thought you had it setup wrong. Anyway try this..add a public variable to your page, set your public variable to your form data and then pass that to your function...like this<BR><BR><script runat="server"><BR>public mydata as string<BR><BR>sub test(sender as object,e as eventargs)<BR>mydata = http://aspmessageboard.com/archive/index.php/request.form("termnum")<BR>end sub<BR></script><BR><BR>now MYDATA should be accessible anywhere inside your page including other subroutines and functions. This code is not precise about it's placement and declaration since I can't see your entire page code. But try that.Can't really do that since the request has no shared methods. The only way that would have worked is if the form method was a shared method but it isn't so it throws the same error message as up above. Shared anything is a pain in my arse. <BR><BR>MattWithout any experience using your type of control I can't help you out any further. Try messing around with my ideas and removing the "shared" off your function. Sorry..Yeah I understand, but the shared thing has nothing to do with the control except to make it function. But the shared thing is part of VB.NET, considering you can have shared variables, shared subs, shared functions. That is what is causing the problem. I just wanted to know if it was actually possible to get a form value into a shared function without passing it as a parameter.<BR><BR>Matt<BR><BR>http://www.15seconds.com/issue/020402.htm<BR><BR>I found this article that might help you ..