I am trying to edit a small macro that was kindly written for me by ratslinger in response to an inquirey I made regarding putting macro text in a Base form textbox. Since I have no way to contact him directly, I’m relegated to asking my question in the forums.
I’m a total noob at LO basic, so try not to laugh too hard. The macro is embedded in a Base form named “Patient Data”. I need the macro to access a sub form named “Chief Complaint” instead of the main form “Patient Data”. The code I’m trying to edit follows:
REM ***** BASIC *****
Sub ShowText(answer)
Dim oForm As Object
Dim oField As Object
oForm = ThisComponent.Drawpage.Forms.getByName("Patient Data")
oField = oForm.getByName("test")
oField.text = oField.text & Chr(13) + Answer
End Sub
How do I pass the subform’s name to the getByName function to access the subform instead of the main form? I’ve not been able to find the naming convention for subforms in LO via Googling.
Thanks, and I hope ratslinger doesn’t mind me posting his code.
docbda