Here is my code so far...
Code: Select all
Sub GETCityStateZip
dim Context
dim DB
dim Conn
dim Stmt
dim Result
dim strSQL As String
dim oForm As Object
dim Company As Object
dim CityStateZip As Object
oForm = ThisComponent.Drawpage.Forms.GetByName("Main")
Company = oForm.getByName("CompanyName")
CityStateZip = oForm.getByName("CityStateZip")
if Company.CurrentValue <> "" then
Context = CreateUnoService("com.sun.star.sdb.DatabaseContext")
DB = Context.getByName("EJK_JOBS")
Conn = DB.getConnection("","")
Stmt = Conn.createStatement()
strSQL = "SELECT City, State, ZIPCode FROM CompanyClient WHERE CompanyClientName = " + "'"+Company.CurrentValue+"'"
Result = Stmt.executeQuery(strSQL)
Conn.close()
CityStateZip.updatestring(Result)
else
endif
End Sub
Please point me in the right direction.
Thanks!