Thanks Dan, silly error.
I am struggling to get the script to run and the problem seems to lay in my query and Search Cursor. It is giving me an error which says
Traceback (most recent call last):
File "D:\Profiles\jByrne\Documents\DARD GIS\TEST SCRIPT\GridMon16_help.py", line 13, in <module>
FP_sampleRows=arcpy.SearchCursor(GridTable.datasource, queryExp)
AttributeError: 'TextElement' object has no attribute 'datasource'
I have attached my code as well. I am running out of ideas and because I don't know it very well (started scripting friday!) I can't really see the wood for the trees.
import arcpy, os, sys
mxd=arcpy.mapping.MapDocument("current")
BUSID_TEMP=arcpy.GetParameterAsText(0)
LayersDF=arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
selLyr=arcpy.mapping.ListLayers(mxd, "FP_sample", LayersDF)[0]
for elm in arcpy.mapping.ListLayoutElements(mxd):
if elm.name=="GridTable": GridTable = elm
ddp=mxd.dataDrivenPages
arcpy.AddMessage(BUSID_TEMP)
pageID=mxd.dataDrivenPages.getPageIDFromName(str(BUSID_TEMP))
mxd.dataDrivenPages.currentPageID=pageID
queryExp="\"BUSID_TEMP\"='"+BUSID_TEMP+"'"
FP_sampleRows=arcpy.SearchCursor(GridTable.datasource, queryExp)
revTable=arcpy.mapping.ListTableViews(mxd,"GridTable")
arcpy.RefreshActiveView()
arcpy.AddMessage("Process Completed")
Thanks