Checkbox Updating Subform Records

damian

Registered User.
Local time
Today, 22:40
Joined
Jun 27, 2004
Messages
87
Hi

I'd like to add an image of a PDA to a form, add unbound checkboxes with their labels relating to different parts of the device. Upon clicking the various parts, a subform record will be added for that particular item.

For example, if the antenna and screen were checked the subform records would put 'Antenna' in subform record 1 and 'Screen' in record 2. Similarly if a box is unticked, the subform is requeried and that record removed from the subform.

I see this approach as being a little less daunting than a combo list within a subform that may contain up to 30 parts and ensures consistency with user selections.

I've trawled the forum looking for a similar scenario but have failed to find anything - can this be achieved without compromising normalisation etc
 
Thanks for the reply Tim

Been busy but just prior to your post finally cobbled something together that appears to do the trick:

Private Sub CheckAntenna_click()
Me.Parts_SubForm.SetFocus
If CheckAntenna= True Then
Me.Parts_SubForm.Form!Parts = "Antenna"
DoCmd.GoToRecord , , acNext
Else
If CheckAntenna= False Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE tblParts.* FROM tblParts WHERE ((tblParts.PartReferencenumber)= Forms!frmParts!ID and (tblParts.part)= 'Head');"
Forms!frmParts!Parts_SubForm.Requery
End If
DoCmd.SetWarnings True
End If
End Sub

Probably a roundabout way of doing things but will sling the code in CheckBox click event for all the necessary parts.

I'm open to more efficient coding suggestions though.....
 

Users who are viewing this thread

Back
Top Bottom