Multiple select

lead 27

Registered User.
Local time
Today, 14:35
Joined
Mar 24, 2007
Messages
147
HI

I am trying to create a form where i have lots of txt boxes but I want all the empty ones to be invisible.
I have sorted the code so that i can make the empty boxes invisible however what I want to know is what is a quick way of selecting multiple txt boxes in a code
i.e my code is:

If Not IsNull(Text0) Then
Me.Text4.Visible = True
Else
Me.Text4.Visible = False
End If

But i need text boxes 4 to 15 to be visible=false how can i do it without writing huge code to say each one individualy

Thanks
 
But i need text boxes 4 to 15 to be visible=false how can i do it without writing huge code to say each one individualy
write a loop, and perform only on empty textboxes:
Code:
dim c as control

  for each c in me.controls
    if typeof c is textbox then
      if isnull(c) then
        c.visible = false
      end if
    end if
  next c
 
Thanks for that. It works great but not exactly what I am looking for as that makes every empty text box invisible but what i forgot to say is that once I have put some text in a box I need the next txt box to become visible so I can use it.

Any ideas???
 
Thanks for that. It works great but not exactly what I am looking for as that makes every empty text box invisible but what i forgot to say is that once I have put some text in a box I need the next txt box to become visible so I can use it.

Any ideas???

Sounds like normalization may be a problem here. 15 text boxes and when one gets text entered, another text box needs to display? What is the data going into the text box? Is it all similar or is it different for all of the text boxes? So, if one can enter data in one text box, which will then display another, what is the purpose?
 
Its just to record notes on a weekly basis, so each text box will contain different information but i dont want empty text boxes to be visible mainly as I will have to print the form
 
Could I still add information straight onto the report?

The db I am making is a driving instructor pupil db. I have a form which has all their details and I also want a way of recording their progress each week. I would use word for this however I want to be able to acess their progress report from their details page. I had created a form with text boxes and bound it to the name field on the details page so I just had to use a command button (open form) to access the pupils progress.

I will also need to print this report so I can take it with me.

Any ideas on the best way to do this.
 
you need a continuous form, so that you can see all the lesssons for a pupil, laid out together - then you can edit any record, or just add a new one at the bottom.

if your database is structured like a spreadsheet

ie a table with fields
pupilname
lesson1
lesson2
lesson3
lesson4

etc, this wont work

---------
you need tables

pupils (pupilid, pupilname, dob, datepassed etc)

and
lessons (pupilid, lessondate, lessontime, cost, notes)

so that you get multiple lesson records for each pupil

--------
then what you have is a form, showing each pupil

another form showing (all) the lessons

then you put this second form INTO the main form as a SUBFORM, Access asks a couple of questions, and hey presto as you move from pupil to pupil, you automatically see just their lessons, presented in an easy to use fashion

----------

yuo can prepare a report in a similar way, although the normal method would be slightly different, based on a query joining the two tables together. The point is, in a report you dont want/cant to edit data, you just want it reported, so the presentation can be different
 

Users who are viewing this thread

Back
Top Bottom