Brandon may have something more specific, but here is a simple OnOnline script:
' Declares Objects within your scene as specific datatypes
dim quad as xpBaseObject
dim textChecker as xpTextObject
dim quadMat as xpMaterial
'References the Scene to find objects in your Object Manager
'the two objects would be called TextChecker and Quad
Self.GetObjectByName("TextChecker",textChecker)
Self.GetObjectByName("Quad",quad)
'Uses the GetMaterialByName method to pull in
'a material from your material manager and assigned it as the quadMat variable
'the textChecker.Text references the Text Property, or contents of your text box
'in your case it could be a datalinq source
'
'A material called "P0" would be assigned
'if the string "P0" was in the text field
Self.Project.GetMaterialByName(textChecker.Text,quadMat)
'With the proper objects assigned, we still need to take 1 more step
'Here we are telling the quad object to use the SetMaterial method
'the 0 represents the index of the face we are assigning
'from above, quadMat = textChecker.Text
quad.SetMaterial(0,quadMat)
#XPression