when form loads, I need to see only two checkboxes. When I check the first
one, two textboxes needs to show. When I move to the next record, I want the
two checkboxes to be displayed by themselves again.
Now, I have 200 records in the table. If the first Checkbox is checked,
display the two textboxes, if the second checkbox is checked, don't display
the two textboxes.
How can I do this for all the records in the table when I browse the recs on
the form.
thank you.
Radu
tina - 18 Jan 2005 22:47 GMT
assuming that the two checkboxes on the form are unbound, try the following:
in the form's Current event procedure, add the following, as
Me!FirstTextboxName.Visible = False
Me!SecondTextboxName.Visible = False
actually, you don't need 2 checkboxes to show/hide the textboxes - you only
need one. since a checkbox represents True/False, On/Off, Yes/No, you can
checkmark a single checkbox to show the textboxes, and un-check the checkbox
to hide them again. add the following code to the checkbox control's
AfterUpdate event procedure, as
Me!FirstTextboxName.Visible = Me!CheckboxName
Me!SecondTextboxName.Visible = Me!CheckboxName
hth
> when form loads, I need to see only two checkboxes. When I check the first
> one, two textboxes needs to show. When I move to the next record, I want the
[quoted text clipped - 10 lines]
>
> Radu
PC Datasheet - 18 Jan 2005 22:54 GMT
First, you only need one checkbox! In design view, set the visible property
of both textboxes to No. Put the following code in the AfterUpdate event of
the checkbox:
If Me!NameOfCheckbox = True
Me!NameOfTextbox1.Visible = True
Me!NameOfTextbox2.Visible = True
Else
Me!NameOfTextbox1.Visible = False
Me!NameOfTextbox2.Visible = False
End If
Put the following code in the OnCurrent event of the form:
Me!NameOfTextbox1.Visible = False
Me!NameOfTextbox2.Visible = False
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource@pcdatasheet.com
www.pcdatasheet.com
> when form loads, I need to see only two checkboxes. When I check the first
> one, two textboxes needs to show. When I move to the next record, I want the
[quoted text clipped - 10 lines]
>
> Radu
Douglas J. Steele - 18 Jan 2005 23:02 GMT
Or simply
Me!NameOfTextbox1.Visible = Me!NameOfCheckbox
Me!NameOfTextbox2.Visible = Me!NameOfCheckbox

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> First, you only need one checkbox! In design view, set the visible
> property
[quoted text clipped - 37 lines]
>>
>> Radu
PC Datasheet - 19 Jan 2005 00:38 GMT
Doug,
I actually like to use this code but I have found dabblers in Access have a
very hard time understanding how it works!
Steve
PC Datasheet
> Or simply
>
[quoted text clipped - 47 lines]
> >>
> >> Radu