[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tdf-discuss] Base macro accessing highlighted data
- Subject: Re: [tdf-discuss] Base macro accessing highlighted data
- From: Joel Madero <firstname.lastname@example.org>
- Date: Mon, 3 Oct 2016 20:41:39 -0700
- To: Robert Großkopf <email@example.com>, firstname.lastname@example.org
Wrong list - try the user list not the discuss list.
On 10/03/2016 08:56 AM, Robert Großkopf wrote:
> Hi meakasteve,
> > What I cannot do is this: I want first to highlight a row in the
> > data-sheet of Form A by clicking the mouse onto the blank cell at
> > the left-hand side of the chosen row, then when I press the button
> > I want the macro not only to open the Form B but also to send data
> > held in one of the fields of the highlighted row of Form A (the
> > field contains primary key) to Form B.
> Don't know how to get an event from the row-marker. But the following
> code would work, if you will put it on the event "onclick" of a field
> in the row you will change:
> Sub Main(oEvent)
> oForm = oEvent.Source.Model.Parent.Parent
> oForm.updateString(2, "new Text")
> End Sub
> First row connects to the form of a field in the tablecontrol. Form is
> parent of the tablecontrol, which is parent of the field.
> Second row updates the second field (2) with the text "new Text". If
> it isn't a string you want to update, you have to change the code here.
> Third row will write the code into the table, which is connected to
> the form.
> This will only work for updating a row, not for inserting new data to
> the row.
> Here some code from the German Handbook, which updates different fields:
> DIM unoDate AS NEW com.sun.star.util.Date
> unoDate.Year = Year(Date)
> unoDate.Month = Month(Date)
> unoDate.Day = Day(Date)
> oForm.updateDate(3, unoDate )
> oForm.updateString(4, "ein Text")
> oForm.updateDouble(6, 3.14)
> oForm.updateInt(7, 16)
> Updating a date is a bit tricky, because it has to be a special
> variable, which defines day, month and year.
To unsubscribe e-mail to: email@example.com
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.documentfoundation.org/www/discuss/
All messages sent to this list will be publicly archived and cannot be deleted
|[tdf-discuss] Re: Base macro accessing highlighted data||meakasteve <firstname.lastname@example.org>|
|[tdf-discuss] Base macro accessing highlighted data||meakasteve <email@example.com>|
|Re: [tdf-discuss] Base macro accessing highlighted data||Robert Großkopf <firstname.lastname@example.org>|
- Prev by Date: Re: [tdf-discuss] Base macro accessing highlighted data
- Next by Date: [tdf-discuss] Re: Base macro accessing highlighted data
- Previous by thread: Re: [tdf-discuss] Base macro accessing highlighted data
- Next by thread: [tdf-discuss] Re: Base macro accessing highlighted data