How do I prevent clicks on a subform causing updates on the main form

前端 未结 3 1410
感动是毒
感动是毒 2020-12-22 12:20

I have a form in a booking system which contains a subform which is a replica of the old ActiveX calendar control that Access 2010 doesn\'t have anymore. One particular use

相关标签:
3条回答
  • 2020-12-22 13:00

    This goes against the way access works by default. the only option I am aware of is to manually load and save your records, ie change all your textboxes etc to unbound in the oncurrent event manually populate the data in the textboxes. when you want to save copy the data from the textboxes back into invisible bound textboxes and mannualy save the record

    0 讨论(0)
  • 2020-12-22 13:02

    Probably best to use the built in date picker. As noted using a dialog form that pops up a calendar and let user select the date and then have the form return the value back to the calling code from the form (so you can make a "general routine" that works for any date control.

    These approaches will get around this save issue. However as noted Access has always saved record automatic when going from main form to sub form. It does this to force PK autonumber key to be generated + saved.

    0 讨论(0)
  • 2020-12-22 13:05

    You can't, as soon as the subform gets focus, the main form will update. I have found in the past that it can be convenient to use a pop-up form for new records. The data can then be added to both forms.

    0 讨论(0)
提交回复
热议问题