Ask Your Question

meakasteve's profile - activity

2019-06-05 13:50:25 +0200 received badge  Famous Question (source)
2019-03-17 05:32:41 +0200 received badge  Famous Question (source)
2018-03-19 21:55:39 +0200 received badge  Famous Question (source)
2018-01-11 19:16:54 +0200 received badge  Famous Question (source)
2017-10-17 11:14:41 +0200 received badge  Notable Question (source)
2017-08-11 12:21:27 +0200 commented answer Base macro transfering text from Word Doc to Textbox

I had not thought of a SQL/Table solution but I think the idea is great and well worth pursuing. Elsewhere in my databas

2017-08-11 12:18:39 +0200 marked best answer Base macro transfering text from Word Doc to Textbox

Recently the question was asked How do I open a Word document from a Base macro? The solution given works wonderfully but how should the code be altered so that the text will appear in a scroll textbox on the form?

To be specific: I'm trying to get the text contained in a writer document into a text box of a database. The idea is to use the text box as a 'Help' guide, giving an inexperienced user of the database information about what the various buttons etc on the form that he/she is presently looking at, do. The text for each particular form would be held in a separate writer document and its contents would be displayed by the macro when the relevant form is opened. The previous solution mentioned above displays the whole document in a separate window rather than having it displayed on the form itself and is therefore inconvenient as a 'Help' text. But the advantage of having the text on a writer file rather than embedded in the macro lies in the convenience with which the text could be modified and maintained.

I have written a macro that gets a text explicitly quoted within the macro into the box (hardly, I agree, a great feat!) and I know how to connect the macro with the open (Base) document event. What I still need to do is to capture the raw text from the writer document and insert it into my Base macro which then puts it into the text box. I think the problem is that I have no idea about writer macro commands. My hope is that someone well-conversed with macros for writer can help me. My present project is developing a rather complex database and I would appreciate any help on, at least for me at the moment, the 'fringe' topic of writer macros!

Bottom Line: I am hoping that someone on the forum can share with me the couple of lines of script that illustrate how to grab the text from the document. With that clue I hope that I can write the the rest of the code.

If you can help I would be most grateful.

2017-08-11 12:18:26 +0200 commented answer Base macro transfering text from Word Doc to Textbox

I had not thought of SQL/Table solution but I think the idea is great and well worth pursuing. Elsewhere in my database

2017-08-11 12:17:29 +0200 commented answer Base macro transfering text from Word Doc to Textbox

I had not thought of SQL/Table solution but I think the idea great and well worth pursuing. Elsewhere in my database I a

2017-08-11 04:41:35 +0200 received badge  Notable Question (source)
2017-08-10 23:08:06 +0200 commented question Base macro transfering text from Word Doc to Textbox

Hi Ratslinger! First my profound apologies. After uploading my question I thought it might be seen as rather curt. (I al

2017-08-10 23:04:43 +0200 edited question Base macro transfering text from Word Doc to Textbox

Base macro transfering text from Word Doc to Textbox Recently the question was asked How do I open a Word document from

2017-08-10 23:04:00 +0200 edited question Base macro transfering text from Word Doc to Textbox

Base macro transfering text from Word Doc to Textbox Recently the question was asked How do I open a Word document from

2017-08-10 22:51:51 +0200 edited question Base macro transfering text from Word Doc to Textbox

Base macro transfering text from Word Doc to Textbox Recently the question was asked How do I open a Word document from

2017-08-10 22:33:40 +0200 commented question Base macro transfering text from Word Doc to Textbox

Hi Ratslinger! First my profound apologies. After uploading my question I thought it might be seen as rather curt. (I al

2017-08-10 22:14:17 +0200 received badge  Popular Question (source)
2017-08-10 22:07:47 +0200 edited question Base macro transfering text from Word Doc to Textbox

Base macro transfering text from Word Doc to Textbox Recently the question was asked How do I open a Word document from

2017-08-10 19:45:05 +0200 edited question Base macro transfering text from Word Doc to Textbox

Base macro transferring text from Word Doc to Textbox Recently the question was asked How do I open a Word document from

2017-08-10 11:03:16 +0200 asked a question Base macro transfering text from Word Doc to Textbox

Base macro transferring text from Word Doc to Textbox Recently the question was asked How do I open a Word document from

2017-08-07 09:32:44 +0200 received badge  Notable Question (source)
2017-08-07 09:03:55 +0200 commented answer macro for highlighting sub-form row in Base

Now works perfectly! Thanks for your endurance.

2017-08-06 16:14:08 +0200 received badge  Commentator
2017-08-06 16:01:20 +0200 commented answer macro for highlighting sub-form row in Base

Placing the last two lines of code in your second solution to my previous question between the line oForm = ThisComponen

2017-08-05 12:42:38 +0200 commented answer macro for highlighting sub-form row in Base

Once again thank you for your help. The code runs perfectly and produces no errors. But testing it on a form of 3330 rec

2017-08-05 12:41:35 +0200 marked best answer macro for highlighting sub-form row in Base

Following my question what code do I need in a Base macro to access a field in highlighted row in a datasheet I received excellent code from Ratslinger which answered my question. I now have a further question based on that code.

I have altered the form 'Customers' so that it not only displays information about that customer but also contains a subform grid, In which details about all the items sent to that customer are displayed. This subform is based on a query into two tables, one listing all the items it is possible to send (with a primary key ItemsID ) and the other listing all the possible customers ( with the primary key CustID). I open the form by highlighting a particular postage in another form - say the postage of itemID = 5 (coffee) to CustID = 2 (Mr Smith). The form 'Customers' shows details about Mr Smith (his telephone numbers and addresses) and also in the subform the items he has been sent (row 1: cakes; row2: butter; row 3: coffee; row 4 milk).

All of this I have written and tested and it seems to work perfectly. When I highlight the row in 'Postage' the macro picks up the CustID and opens the form 'Customers' which contains also displays the Query showing the items this CustID received.

What I am trying to do is to modify the code further so that the row in the subform grid which says Mr Smith received coffee is highlighted. I want this highlighted because it was this that originated my search.

I think I need to do a couple of things:

First I must pick up the ItemID along with the CustID in GetCustID(). I presume this will be

oObj2 = oControl.getByName("itemID")

iItemID = oObj2.getCurrentValue() - where iItem is global.

Secondly I must highlight this item in the subform grid by modifying OpenFormAt Record().

Any help identifying the appropriate alterations would be much appreciated because I'm not making any progress:(

2017-08-03 01:12:43 +0200 received badge  Popular Question (source)
2017-08-02 15:58:50 +0200 edited question macro for highlighting sub-form row in Base

macro for highlighting sub-form row in Base Following my question what code do I need in a Base macro to access a field

2017-08-02 15:57:44 +0200 asked a question macro for highlighting sub-form row in Base

macro for highlighting sub-form row in Base Following my question what code do I need in a Base macro to access a field

2017-08-02 14:03:40 +0200 marked best answer what code do I need in a Base macro to access a field in highlighted row in a datasheet

Hi

Can someone knowledgeable in programming macros for Base help me?

I have a form (Form A) which displays data as a data-sheet. This form also contains a button. When this button is pressed it activates a macros which opens another form (Form B) in the databank. That bit I can do.

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.

More explicitly: The data-sheet in Form A contains a list of customers and their addresses, I select a particular customer from the data-sheet by clicking on it with the mouse. Base then highlights the row and marks it with a little green cursor (all done automatically - no macro required!) I then click on the press-button which activates the micro and this should open Form B which contains further details about the customer I marked in Form A such as what purchases he/she has made in the past. As my macro currently contains no code to pick up the data in the highlighted row, the wrong customer appears when Form B is opened.

If anyone can tell me the script that I need to do this I would be most grateful.

meakasteve

2017-08-02 14:03:40 +0200 commented answer what code do I need in a Base macro to access a field in highlighted row in a datasheet

Hi Ratslinger. If I have altered the form 'Customers' so that it also contains a subform grid, In this grid are listed a

2017-07-31 16:12:41 +0200 commented answer Base macro that opens a new/clean record in another form

Many thanks Ratslinger. Yes it was only a minor change but that testifies to the elegance of your original code!

2017-07-31 16:12:36 +0200 marked best answer Base macro that opens a new/clean record in another form

I have a form that lists customer's names and addresses in a grid. I can highlight a particular row, press a button on the form and another form opens up displaying a lot more details about that customer. Both the first form (with the button) and the second (with the details) are based on the same table. The macro which achieves this and is attached to the first form is based on Ratslinger's solution to my question "what code do I need in a Base macro to access a field in highlighted row in a datasheet" from Oct. 14 2016. His solution captures the primary key associated with the customer highlighted in the first form and uses it to display in the second form the data relevant to that customer.

I am now struggling with writing a second macro which would be attached to a second button on the first form and would cause the second form to be opened (irrespective of which row is highlighted in the first form) at a new record. I could then enter details about a new customer on this second table and when this second form is closed this data would be stored in the table (and be displayed in the list of the customer names and addresses in the grid of the first form).

Basically I want a macro that opens up a new/clean record in second form in which data can be entered and which automatically stores the autovalue of the new primary key number for the table. The nearest reference to this problem I have found on the internet is https://forum.openoffice.org/en/forum.... But it has so far not helped me. If anyone in the the community can help me I would be most grateful.

2017-07-31 07:57:42 +0200 received badge  Popular Question (source)