Da ich das ganze aber als TextField angelegt habe wird zwar in der Tabelle die Kundennr. angezeigt (bsp. 12345) in der Eingabezeile aber '12345.
Von der Funktion NumericField habe ich mir nun eine Lösung erhofft. Leider fehlt mir die Erfahrung mit diesen Feldern, da mir bisher Textfelder vollkommen ausgereicht haben.
Kann mir jemand kurz zeigen wie ich mein Makro dahingehend ändern muss. Das betroffene Feld ist das oTB3
Code: Alles auswählen
Sub Dlg_Felder1
oDoc = thisComponent
GlobalScope.BasicLibraries.LoadLibrary("Tools")
DLG = LoadDialog("Standard", "Dlg_Felder1", oDoc.DialogLibraries)
oTB1 = DLG.GetControl("TextField_Datum")
oTB2 = DLG.GetControl("TextField_Zeit")
oTB3 = DLG.GetControl("TextField_Kundennr")
oTB4 = DLG.GetControl("TextField_Zweck")
oTB5 = DLG.GetControl("TextField_Sonstiges")
oTB1.Model.Text = oDoc.Sheets(0).GetCellRangeByName("B2").String
oTB2.Model.Text = oDoc.Sheets(0).GetCellRangeByName("D2").String
oTB3.Model.Text = oDoc.Sheets(0).GetCellRangeByName("B4").String
oTB4.Model.Text = oDoc.Sheets(0).GetCellRangeByName("B7").String
oTB5.Model.Text = oDoc.Sheets(0).GetCellRangeByName("B8").String
DLG.execute()
End Sub
Sub DLG_Felder_Schreiben1
oDoc.Sheets(0).GetCellRangeByName("B2").String = oTB1.Model.Text
oDoc.Sheets(0).GetCellRangeByName("D2").String = oTB2.Model.Text
oDoc.Sheets(0).GetCellRangeByName("B4").String = oTB3.Model.Text
oDoc.Sheets(0).GetCellRangeByName("B7").String = oTB4.Model.Text
oDoc.Sheets(0).GetCellRangeByName("B8").String = oTB5.Model.Text
DLG.endexecute()
End Sub

Grüße
Ibanez