Displaying controls on forms in datasheet view

P

Peter Hallett

I have an invoice form which, when payment is to be made by a mixture of methods – eg cash, credit card and account – opens a supplementary form, in pop-up mode, for the entry of the amounts paid by each method. The latter form is bound to a payment table comprising two columns – Payment Method and Amount. The former lists the permitted payment methods. The latter is available for the entry of the corresponding payments. There is thus a distinct record for each method of payment. Displaying the form in datasheet view then offers a particularly convenient way of entering the payment break-down

A natural corollary is that, before the supplementary form is closed, the total of the constituent payments be reconciled with the invoice total. Should this be unsuccessful, a warning message is displayed, with the requirement that the entered amounts be checked and amended as necessary – and herein lies the problem. I would like to include a form close control button on the popup form, which would enable the reconciliation check to be included in its event procedure. If the test were successful, the form would close. If not, a standard MsgBox would display the warning message and form closure could then be bypassed, leaving the form open for amendment. Because the form is displayed in datasheet format, however, I do not seem to be able to display a form closure (or any other) control button. I would ideally like to locate this in the form footer, which I also cannot display, leaving me with no option but to utilise the form close button on the title bar, putting the reconciliation check in the On Close procedure. The problem with that, of course, is that form closure follows, whether or not the reconciliation check is successful. Should it fail, there is little alternative but to re-invoke the pop-up form from its parent – a particularly clumsy solution

I am sure that someone must be able to suggest something more elegant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top