开发者

Continuous Subform

开发者 https://www.devze.com 2023-01-23 07:40 出处:网络
I have an access database that uses a continuous subform on a form. The continuous subform contains a date field follo开发者_如何学Cwed by three check boxes that link to the single date field. The use

I have an access database that uses a continuous subform on a form. The continuous subform contains a date field follo开发者_如何学Cwed by three check boxes that link to the single date field. The user must be able to enter as many dates as they need to and check the appropriate boxes which will pull in that date into the associated field in the table. If the user clicks all three check boxes connected to any of the date fields is there a way to make a field on the actual form "True". For example:

Continuous Subform

Date       Field1    Field2    Field3

1/1/2010      X

1/2/2010                X

1/3/2010                          X

Form

Field1 = True


What you want to do is this:

  1. add an After_Update event to each of those check boxes, have it launch a Sub (so that you don't have to put the same code in each checkbox)
  2. in the Sub that you create, walk the recordset for the subform and checks that exactly one checkbox in each of the rows/columns is checked.
  3. If it's prefect update the value on the parent form. e.g.,

    Me.Parent!Field1= true

0

精彩评论

暂无评论...
验证码 换一张
取 消