Access 2007: Forms: Need to populate text boxes depending on user input

hitesh_sid

New member
Local time
Today, 20:03
Joined
Dec 6, 2008
Messages
1
Hi,

I am making a Form in Access 2007 and need to populate some text boxes depending on the input provided by input.

In case the User enters 3 in the Field 1 then 3 new text boxes should come below that filed on the form.

So to generalize if X is the input then X text boxes should come below that field in the form.

Can some body help me in finding the code/Macro that i would need to write in order to have the fields on the form.

Thanks and Regards
Hitesh Sethi
 
you could make the three text boxes invisible then wright code to make them visible again General use you could use key press lost focus etc....

Private Sub yourfield_AfterUpdate()
Select Case Me.yourfield.Value
Case 1
'make text 1 true and the other two false in case user changes field imput'
'they will disapear again same with case 2 and 3'
Me.yourtextbox.Visible = True
Me.yourtextbox2.Visible = false
Me.yourtextbox3.Visible = false
Case 2
Me.yourtextbox.Visible = True
Me.yourtextbox2.Visible = True
Me.yourtextbox3.Visible = false
Case 3
Me.yourtextbox.Visible = True
Me.yourtextbox2.Visible = True
Me.yourtextbox3.Visible = True
'add more cases if you wish here'
End Select
End Sub
 

Users who are viewing this thread

Back
Top Bottom