How to do this depends a lot upon what you know and how you want this to be actually done.
Are you going to print this using Report Builder or Writer or even something else? Do you want this to print immediately by, let’s say, pressing a button on the form? Are you knowledgable in programming macros?
You can add a boolean field to the record for print selection. Then create a query to select all records with this field ON and use that for wherever the printing will occur. After printing, the flag must be cleared.
Instead of setting a new field, possibly use a table filer record to store the data for this ID & base the query upon that.
In a macro, the button could activate the writing of this data to a temp file which is passed on to the printing program and the process started by the macro.
There are probably other possibilities but again it depends upon just how you want it to work and your abilities to complete this, especially concerning macro coding.
Edit:
Having presented multiple ways in my answer to print, it is not clear why you posted the comment.
Just to be clear, printing directly from the form would require you to create a macro. Since you state you don’t have any macro experience, the next easiest way is to print based on a parameter input for a query. The query is used as input to Report Builder (and again no mention of how you actually wanted to print even after asking in answer).
The report on the sample is simply printing the bar code field. There is no specific format since the label type and such are determined by you. To run the demo, there have been two records entered into the table - ID = 0 & ID = 1. In the Reports
section, double click on BarcodeLabel
. A Parameter Input dialog will pop up. In the Value
field, enter 0 or 1 (record ID to select). On selecting OK
button (Enter
will do) the “Label” will pop up ready to be printed.
All of this is in the LO Base documentation found here.
Sample: BarcodePrintSample.odb
I did forget to mention - the odb does not carry the special bar code font with it. So first edit the Report and chage the field containing the bar code to use the font you installed on your system. The same can be said of the form I have on the sample.
Edit:
To avoid possible confusion, this next sample is the same as the first except where bar codes appear in the first, this one displays actual text.
Sample 2 - BarcodePrintSample (copy).odb