On Jun 23, 9:23*pm, zufie <john.marru...@illinois.govwrote:
I must combine the information from two forms/tabs on a main form.
The idea is to insert two checkboxes on the main form.
Then based on the checkbox checked would then automatically highlight
those textboxes that need to be filled in by the end user.
Any advice on how best to do this?
Thanks!
Zuf
Hello,
Here is my idea - use Tag property of the text box field.
Assuming you have (for sample purpose here) 2 check boxes and several
text box fields, say 4. By clicking first check box it will add shadow
to first 2 text boxes and remove shadow from second 2 text boxes. Open
form in design view and select first 2 text boxes. In property Tag
write "Shadow1", for second 2 text boxes write "Shadow2" (without
quotes).
For first check box use this code:
Private Sub chkBox1_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And chkBox1 = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub
Create similar code for second check box. 109 means text box
(acTextBox), 4 means "Shadowed", 1 means "Flat".
Use this idea to complete your form.
Regards,
Branislav Mihaljev
Microsoft Access MVP