Connecting Tech Pros Worldwide Forums | Help | Site Map

Trouble with Check Boxes in records...

David
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi,

I have a form with a sub-form.
The Main form shows a selected product, and the sub-form shows the
package contents for that product as follows:

Item | Qty | Print (Checkbox)

Basically, when the sub-form loads, I want all the Item lines 'Print'
check boxes CHECKED. The user can then UNSELECT certain package items
dependent on the customers requirements.

(A report can then be printed which only lists the CHECKED lines)

Basically, I need to have all the checkboxes CHECKED on FORM LOAD and
all CHECKED back when the form is closed.

How can this be done ?

Appreciate your help.

David

Jim Allensworth
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Trouble with Check Boxes in records...


On 6 Apr 2004 08:03:19 -0700, david@scene-double.co.uk (David) wrote:
[color=blue]
>Hi,
>
>I have a form with a sub-form.
>The Main form shows a selected product, and the sub-form shows the
>package contents for that product as follows:
>
>Item | Qty | Print (Checkbox)
>
>Basically, when the sub-form loads, I want all the Item lines 'Print'
>check boxes CHECKED. The user can then UNSELECT certain package items
>dependent on the customers requirements.
>
>(A report can then be printed which only lists the CHECKED lines)
>
>Basically, I need to have all the checkboxes CHECKED on FORM LOAD and
>all CHECKED back when the form is closed.
>
>How can this be done ?
>
>Appreciate your help.
>
>David[/color]
Can you not just run an update query on the form's On Open event?
-----------------------------------
Private Sub Form_Open(Cancel As Integer)
Dim strDoPrint As String

strDoPrint = "UPDATE tblPkgContents SET Print = True"
CurrentDb.Execute strDoPrint, DbFailonerror
End Sub
-----------------------------------
And then set them back when the form closes...
-----------------------------------
Private Sub Form_Close()
Dim strDoPrint As String

strDoPrint = "UPDATE tblPkgContents SET Print = False"
CurrentDb.Execute strDoPrint, DbFailonerror
End Sub
-----------------------------------

- Jim
Closed Thread