Automatically Append New Blank Row/Line/Record in Subform (Bounded Form)

  • Thread starter Thread starter Günter Brandstätter
  • Start date Start date
G

Günter Brandstätter

Hi,
I would use the allowAdditions property as follows:

in the form.open event
me.subform_name.Form.AllowAdditions=False

in the onKeyPress event of the form:
if key=vbkeyXX then 'whatever key you want'
me.subform_Name.Form.AllowAdditions = True

and in the forms onCurrent event:
if not me.newrecord then me.subform_name.Forms.AllowAdditions = False

this will prevent the blank line for the new record appearing

hth
Günter
 
Hi,

//// I got reply of below question but couldn't make around. /////

I designed a Hospital Billing System. Its working fine but during the
developmentof this project I faced a problem which I also posted
on this Newsgroup, however couldn't get any solution. The scenario
is as follows:

SCENARIO:

Main & SubForms are bound to tables with 1 to Many relationship.This
Form (Subform) records SERVICES rendered on One Voucher. On a
single voucher 1 or more services may be rendered.

Now User Input Voucher # in Main Form with Date and after filling other
field on main form User records MULTIPLE SERVICES RENDERED
in Subform. As the user press any Single Key in first record of
Subform A NEW BLANK Record/Line/Row is Appended in the subform.

I know that this is DEFAULT behavior of MS ACCESS table. But I want
to bypass this behavior. IN SUBFORMS Pressing any key SHOULD NOT
APPEND NEW BLANK RECORD in subform. New Row/Line/Record
SHOULD ONLY be appended when user press any specific button.

Hope this time I will get a reply with sample code.

Thanks

SYED
 
Back
Top