Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello,

It appears your macro is working just as you coded it to do.

stQuery = Replace(stQuery, ":sid","?")

:sid appears twice in your Insert statement. Therefore you need two different substitutions.

oStmt.setInt(1, iStudNumber)

is one but you need to fill the second:

oStmt.setInt(2, iStudNumber)

Now as for the form, you are reloading oForm and filtering the result with iStudNumber. Seems this would display one record. If not what is wanted, why filter?

Also, please include vital information in your questions - specific LO version; OS; database used.

Above may differ depending upon what is being used.

Hello,

It appears your macro is working just as you coded it to do.

stQuery = Replace(stQuery, ":sid","?")

:sid appears twice in your Insert statement. Therefore you need two different substitutions.

oStmt.setInt(1, iStudNumber)

is one but you need to fill the second:

oStmt.setInt(2, iStudNumber)

Now as for the form, you are reloading oForm and filtering the result with iStudNumber. Seems this would display one record. If not what is wanted, why filter?

Also, please include vital information in your questions - specific LO version; OS; database used.

Above may differ depending upon what is being used.

Edit:

Have done some further reviewing. Seems I have previously presented you with how to set multi-parameters in this post -> Using SQL cursor and loop in LO base macro. .

Also, these posts may interest you:

SOLVED: Read values from selected rows in a table control

Base Table Grid Control restore the rows selection after applying a filter