List Box in Form

V

Vanessa Farmer

I need a list box to limit the number of values it displays based on the
value of another feild in the same form. How can this be done?
 
V

Vanessa Farmer

Thanks, I tried that and i cant get the expression correct in the query. I
have two list boxes on the form 1st is company, 2nd is Unit Number. I set up
a query with both feilds and on the criteria line for company I put =
[Forms]![Revenue]![Company] (Revenue is the name of my form. Then in the Row
Source for the Unit number list box in the form I choose the name of the
query. When I try it out the list box for unit number is blank. What am i
doing wrong? Your help is much appreciated!
 
K

KARL DEWEY

Did you refresh/requery after the company is selected? Use an event or macro
to refresh/requery.

Vanessa Farmer said:
Thanks, I tried that and i cant get the expression correct in the query. I
have two list boxes on the form 1st is company, 2nd is Unit Number. I set up
a query with both feilds and on the criteria line for company I put =
[Forms]![Revenue]![Company] (Revenue is the name of my form. Then in the Row
Source for the Unit number list box in the form I choose the name of the
query. When I try it out the list box for unit number is blank. What am i
doing wrong? Your help is much appreciated!

KARL DEWEY said:
Use a query as record source. Use the other field in criteria for the query.
 
V

Vanessa Farmer

Thanks, I am not good with code. So in the properties for the list box
Company, on the Event tab and in After Update i put [event procedure] and the
code looks like (i know this is so wrong)
Private Sub Company_AfterUpdate(RefreshQUERY1)

End Sub
Can you help me with my meager attempt???

KARL DEWEY said:
Did you refresh/requery after the company is selected? Use an event or macro
to refresh/requery.

Vanessa Farmer said:
Thanks, I tried that and i cant get the expression correct in the query. I
have two list boxes on the form 1st is company, 2nd is Unit Number. I set up
a query with both feilds and on the criteria line for company I put =
[Forms]![Revenue]![Company] (Revenue is the name of my form. Then in the Row
Source for the Unit number list box in the form I choose the name of the
query. When I try it out the list box for unit number is blank. What am i
doing wrong? Your help is much appreciated!

KARL DEWEY said:
Use a query as record source. Use the other field in criteria for the query.

:

I need a list box to limit the number of values it displays based on the
value of another feild in the same form. How can this be done?
 
K

KARL DEWEY

Personnaly I use macros.

Vanessa Farmer said:
Thanks, I am not good with code. So in the properties for the list box
Company, on the Event tab and in After Update i put [event procedure] and the
code looks like (i know this is so wrong)
Private Sub Company_AfterUpdate(RefreshQUERY1)

End Sub
Can you help me with my meager attempt???

KARL DEWEY said:
Did you refresh/requery after the company is selected? Use an event or macro
to refresh/requery.

Vanessa Farmer said:
Thanks, I tried that and i cant get the expression correct in the query. I
have two list boxes on the form 1st is company, 2nd is Unit Number. I set up
a query with both feilds and on the criteria line for company I put =
[Forms]![Revenue]![Company] (Revenue is the name of my form. Then in the Row
Source for the Unit number list box in the form I choose the name of the
query. When I try it out the list box for unit number is blank. What am i
doing wrong? Your help is much appreciated!

:

Use a query as record source. Use the other field in criteria for the query.

:

I need a list box to limit the number of values it displays based on the
value of another feild in the same form. How can this be done?
 
J

Jeff Boyce

Vanessa

Private Sub Company_AfterUpdate()
Me.Requery
End Sub

.... if you wish to refresh the form's data.

Regards

Jeff Boyce
<Office/Access MVP>

Vanessa Farmer said:
Thanks, I am not good with code. So in the properties for the list box
Company, on the Event tab and in After Update i put [event procedure] and
the
code looks like (i know this is so wrong)
Private Sub Company_AfterUpdate(RefreshQUERY1)

End Sub
Can you help me with my meager attempt???

KARL DEWEY said:
Did you refresh/requery after the company is selected? Use an event or
macro
to refresh/requery.

Vanessa Farmer said:
Thanks, I tried that and i cant get the expression correct in the
query. I
have two list boxes on the form 1st is company, 2nd is Unit Number. I
set up
a query with both feilds and on the criteria line for company I put =
[Forms]![Revenue]![Company] (Revenue is the name of my form. Then in
the Row
Source for the Unit number list box in the form I choose the name of
the
query. When I try it out the list box for unit number is blank. What am
i
doing wrong? Your help is much appreciated!

:

Use a query as record source. Use the other field in criteria for
the query.

:

I need a list box to limit the number of values it displays based
on the
value of another feild in the same form. How can this be done?
 
V

Vanessa Farmer

thanks that works perfect!

Jeff Boyce said:
Vanessa

Private Sub Company_AfterUpdate()
Me.Requery
End Sub

.... if you wish to refresh the form's data.

Regards

Jeff Boyce
<Office/Access MVP>

Vanessa Farmer said:
Thanks, I am not good with code. So in the properties for the list box
Company, on the Event tab and in After Update i put [event procedure] and
the
code looks like (i know this is so wrong)
Private Sub Company_AfterUpdate(RefreshQUERY1)

End Sub
Can you help me with my meager attempt???

KARL DEWEY said:
Did you refresh/requery after the company is selected? Use an event or
macro
to refresh/requery.

:

Thanks, I tried that and i cant get the expression correct in the
query. I
have two list boxes on the form 1st is company, 2nd is Unit Number. I
set up
a query with both feilds and on the criteria line for company I put =
[Forms]![Revenue]![Company] (Revenue is the name of my form. Then in
the Row
Source for the Unit number list box in the form I choose the name of
the
query. When I try it out the list box for unit number is blank. What am
i
doing wrong? Your help is much appreciated!

:

Use a query as record source. Use the other field in criteria for
the query.

:

I need a list box to limit the number of values it displays based
on the
value of another feild in the same form. How can this be done?
 
Top