Link to home
Start Free TrialLog in
Avatar of James
JamesFlag for Canada

asked on

Insert a line in a continuous form (instead of adding it at the end)

I have an invoice entry form that has a subform on it to hold all of the invoice lines. My client often adds comments about a particular invoice line immediately after that line of the invoice (entering comments as their own invoice lines). They often enter comments for several different items on the invoice.

Can someone recommend a code sample that would allow me to insert a blank line in the invoice detail lines wherever the client needs to (rather than just at the end)?

At the moment, my plan is to write code to move all the lines after the insert point down. But before I re-invent the wheel, I was wondering if there was something out there for this already.

Thank you!
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

I think what you are describing would be extremely difficult to do.

I would suggest that you think about having a pop-up form that just contains a memo field (and sufficient line ID fields) and the user can add comments into this.  The comments field would be part of the invoice line record, but not visible in the subform.

You could display the pop-up by say, double-clicking one of the controls in the detail lin.
And you could use conditional formatting of that contro to have different colour background depending on whether the memo field was empty or not.
Agree with Pete...

Are you asking for this functionality specifically (Inserting blank rows)...?
Because inserting "blank lines" is not something that is done in a standard Database...)

Sometimes it is best to state your ultimate need, then experts can suggest solutions.

So to be clear, are you seeking "one" comment per Invoice, ...or one comment per invoice line Item (Product)?

Perhaps I am not understanding, but why not just add a "Comments" field to the corresponding table(s)?

JeffCoachman
Avatar of James

ASKER

Hi,

Thanks for your input.

If the whole process were entirely up to me, I'd do it differently. But the client has very exacting demands about how they want the invoices to be entered and printed.

For simplicity, lets ignore comments and blank lines. The client's demands include wanting to put the detail lines in exactly the order they desire. (Due to the nature of their business, the order is relevant and the invoice would be confusing/baffling if the lines were not in a specific order.) So if they have 15 lines entered and realize that they missed one, they want to be able to add it but they want to be able to add it in the place of their choosing.

Hence the need to be able to insert a line rather than just add it to the end.

James
The client may have: "very exacting demands about how they want the invoices to be entered and printed."
...but they should not dictate "How" the developer goes about actually achieving those requirements...
;-)

You can "Sort" records in any order you like.

So if a Client has Four "Lines"
Design
Build
Test
...Then they want to add a fourth item: "Approve", ...to be under "Design".

You can create a "Sort" field, where they enter a "Position" where they want each record.
Then you can Sort by this field.
So this:
1. Design
2. Build
3. Test
...Becomes this:
1. Design
2. Approve
3. Build
4. Test
...by the user changing the "sort" value field.

(Obviously here you may want to create a system so that a sort number cannot be duplicated, but this is another concern...

JeffCoachman
If this is what you needed then I can work up a sample database
ASKER CERTIFIED SOLUTION
Avatar of James
James
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James

ASKER

It's clear that this is an uncommon request, so no currently-existing solution is likely.