Subform Problem

  • Thread starter Thread starter cymichaelip
  • Start date Start date
C

cymichaelip

Hi, I am new in MS Access. I am using MS Access 2002. I have a main
form which has 10 label (from label1 to lable10), main form also has a
subform which has 10 records. Subform has 2 column (one is Position ID
another one is Status). My problem is when I load the form, All
Labels in the main form will automatic change the color according to
the "status" column on the Subform, just like my example below. Any
idea?

for e.g. - Position ID =1 and the Status = "Open" then the
Label1.backcolor=Red
Position ID =2 and the Status = "Open" then the
Label2.backcolor=Red
Position ID =3 and the Status = "Close" then the
Label3.backcolor=Blue
Position ID =4 and the Status = "Cancelled" then the
Label4.backcolor=Green
.....

Do I need to use for Loop? how? Please teach me. Thanks in advance
Michael
 
Which field is the link between the form/subform? If there is no linked
field, then why are you using a subform? If status determines the color, then
you can use a Select Case that changes the font color/background of the
label.
 
Thanks Ricoy

There is no linked field. I find the solution, I have used a for loop
inside with a Dlookup function. It works perfect now.

Thanks again
Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top