Filter by Checkbox

B

BennyDHill

Hi,

I have a table that has date | payment | docket number | delete as the
headings.
The delete column is a check box column.

On a mainform (1) i have invoice data, and a subform (2) with the payment
history for that invoice. there is also another subform (3) that the user can
'add' a payment, and then when refreshed adds to subform (2).

Where i come into problems is with subform (4). (4) opens via a button on
the main form and displays the same data as (2) but with the option to check
or uncheck the |Delete| check box. What i want to do is to be able to make
changes to the check boxes and then when it is closed, have it update (2) in
the main form.

In essence this should simply filter out the checked boxes so that the
payments that have been checked are not displayed and are not totaled on the
main form. (i.e. only display data in the subform on the mainform that has
not had the |delete| column checked and where the |docketno| from the main
form is the same on the subform concerned)

I have tried adding to the 'open form' macro on the main form, which i have
attached. i am not sure if this is along the right track...

Private Sub CmdDeletePayment_Click()
On Error GoTo Err_CmdDeletePayment_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmDeletePayment"

stLinkCriteria = "[DocketNo]=" & Me![DocketNo] And [Delete] = 1
DoCmd.openform stDocName, , , stLinkCriteria

Exit_CmdDeletePayment_Click:
Exit Sub

Err_CmdDeletePayment_Click:
MsgBox Err.Description
Resume Exit_CmdDeletePayment_Click

End Sub

Thankyou.
 

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