Sorry if I need to post in a special forum - I’m been using open office for a little while & just found LibreOffice. I have a fairly complex data entry form & I want to copy a date from a textbox and include the date in my insert query to another table. Can’t get it to accept the date. The numeric data inserts successfully.
Thanks
DrawPageObj = ThisComponent.DrawPage
DrawPageFrmFrom = DrawPageObj.Forms.getByName("frmTrips")
iTripID = DrawPageFrmFrom.GetByName("numTripID")
iTripDate = DrawPageFrmFrom.GetByName("txtTripDate")
DrawPageFrmFacility = DrawPageObj.Forms.getByName("frmFacilities")
iFacilityID = DrawPageFrmFacility.GetByName("numFacilityLnk")
oForm.updateRow
oForm.moveToInsertRow
oStatement = oForm.ActiveConnection.createStatement()
sColumns = ""
sColumns = sColumns & """TripID"""
sColumns = sColumns & ", ""FacilityID"""
'sColumns = sColumns & ", ""VisitDate"""
'sSQL = "INSERT INTO ""Visits"" (" & sColumns & ") VALUES ( " & Str(iTripID.Value) & " , " & Str(iFacilityID.Value) & " , ""# & (iTripDate.Text) & "#" )"
sSQL = "INSERT INTO ""Visits"" (" & sColumns & ") VALUES ( " & Str(iTripID.Value) & " , " & Str(iFacilityID.Value) & " )"
oStatement.executeUpdate( sSQL)
oForm.reload
oForm.first