This is a bit lengthy. I hope u have the patience to go thru it and reply.<BR><BR>I have this asp page with tabs. It is one single asp page - but only part info is shown at any given time (javascript + css). Each tab holds a different type of info viz. Branch Info, Godown Info, Factory Info. <BR><BR>On the right side of the page, links to existing records are shown. for e.g. if i&#039;m viewing "Branch Info", I can see a blank form & at the right side column links to all exiting Branches for that company is provided. <BR><BR>==&#062;Each form element value = &#060;%=variablename%&#062; (i have used variables as default values <BR><BR>There are 5 different possible events on this page<BR>1) on page load<BR>contactid= 0<BR>all variableValues=""<BR>so all form elements blank & hence blank form<BR><BR>2) on tab change<BR>contactid= 0<BR>all variableValues=""<BR>so all form elements blank & hence blank form<BR><BR>3) onsubmit<BR>execute sp1 to insert record<BR>get @@identity<BR>execute sp2 from sp1 to refresh rs<BR>display newly inserted values in the form<BR><BR><BR>4) onupdate <BR>execute sp3 to update record<BR>execute 2nd sp from sp3 to refresh rs<BR>display the updated values in the form <BR><BR>5) onclick existing contact link<BR>contactid passed as query string<BR>objRS.filter="cnctID=contactid" (contactid is a variable that retrieves the value from the querystring)<BR>Displays the values for the contact in the form<BR><BR>NOW FOR EACH OF THE ABOVE EVENTS, MY SQL QUERY OR COMMAND IS SUPPOSED TO BE DIFFERENT. SO HOW DO I DO THIS? Can I use a javascript function to change value of a variable that can in turn be used by my vbscript to use the appropriate sql query???<BR><BR>==&#062;PLS NOTE: The right side links also require to use filter. E.g. only Branch links on the "Branch Info page"<BR>Each record has a field named AddressType=f/g/b<BR>f-&#062;factory<BR>g-&#062;godown<BR>b-&#062;branch<BR><BR>I definitely need help on this one.