Update subform from combo box

M

Mike_can

Hi every1.

Sorry to repeat this question but i do not understand very well the previous
postings since i'm a beginner here...

I got a combo box that allows me to select a Purchase Order.

I need is that after i select a PO in the combo box, ONLY the records of the
table with that PO number appear in a subform.

PO #
1
2
3


PO# Material Price
1 Paper $5
1 Pencils $1
1 Ruler $3
2 paper clips $2
2 notebook $1
3 mousepad $3
3 eraser $0.5

So, when i Select the PO # 2, i need to show on the scren (a subform
maybe?), all the items belonging to that PO.

This is just for consulting, i don't need to save the info.

Thanks a lot

Mike
 
O

Ofer

In the subform properties, the parent child properties, enter the PO# field
name in both of them.
After you select a new PO# it should refresh the subform automatically and
display all the records that belong to that PO#.
===================================
Or
The record source of the sub form can have a link to the combo in the main
form

Select * From TableName Where [PO#] = Forms![MainFormName]![ComboName]

And on the after update event of the combo, you can write the code
Me.SubFormName.requery
 
M

Mike_can

Hi Ofer.. i didn't understand very well the second choice...

where should i put the link?

Thanks,

Miguel

Ofer said:
In the subform properties, the parent child properties, enter the PO# field
name in both of them.
After you select a new PO# it should refresh the subform automatically and
display all the records that belong to that PO#.
===================================
Or
The record source of the sub form can have a link to the combo in the main
form

Select * From TableName Where [PO#] = Forms![MainFormName]![ComboName]

And on the after update event of the combo, you can write the code
Me.SubFormName.requery




Mike_can said:
Hi every1.

Sorry to repeat this question but i do not understand very well the previous
postings since i'm a beginner here...

I got a combo box that allows me to select a Purchase Order.

I need is that after i select a PO in the combo box, ONLY the records of the
table with that PO number appear in a subform.

PO #
1
2
3


PO# Material Price
1 Paper $5
1 Pencils $1
1 Ruler $3
2 paper clips $2
2 notebook $1
3 mousepad $3
3 eraser $0.5

So, when i Select the PO # 2, i need to show on the scren (a subform
maybe?), all the items belonging to that PO.

This is just for consulting, i don't need to save the info.

Thanks a lot

Mike
 
O

Ofer

Open the subform properties, the record source property contain the records
(Table) that the subform is bounded to.
Click on the button on the right with the three dots, that will show you the
recordsource, change it with the link as I showed you in the prev post.
The link should be between the field in the table to the field in the main
form.

Mike_can said:
Hi Ofer.. i didn't understand very well the second choice...

where should i put the link?

Thanks,

Miguel

Ofer said:
In the subform properties, the parent child properties, enter the PO# field
name in both of them.
After you select a new PO# it should refresh the subform automatically and
display all the records that belong to that PO#.
===================================
Or
The record source of the sub form can have a link to the combo in the main
form

Select * From TableName Where [PO#] = Forms![MainFormName]![ComboName]

And on the after update event of the combo, you can write the code
Me.SubFormName.requery




Mike_can said:
Hi every1.

Sorry to repeat this question but i do not understand very well the previous
postings since i'm a beginner here...

I got a combo box that allows me to select a Purchase Order.

I need is that after i select a PO in the combo box, ONLY the records of the
table with that PO number appear in a subform.

PO #
1
2
3


PO# Material Price
1 Paper $5
1 Pencils $1
1 Ruler $3
2 paper clips $2
2 notebook $1
3 mousepad $3
3 eraser $0.5

So, when i Select the PO # 2, i need to show on the scren (a subform
maybe?), all the items belonging to that PO.

This is just for consulting, i don't need to save the info.

Thanks a lot

Mike
 
M

Mike_can

Thanks a lot!!!

Mike_can said:
Hi Ofer.. i didn't understand very well the second choice...

where should i put the link?

Thanks,

Miguel

Ofer said:
In the subform properties, the parent child properties, enter the PO# field
name in both of them.
After you select a new PO# it should refresh the subform automatically and
display all the records that belong to that PO#.
===================================
Or
The record source of the sub form can have a link to the combo in the main
form

Select * From TableName Where [PO#] = Forms![MainFormName]![ComboName]

And on the after update event of the combo, you can write the code
Me.SubFormName.requery




Mike_can said:
Hi every1.

Sorry to repeat this question but i do not understand very well the previous
postings since i'm a beginner here...

I got a combo box that allows me to select a Purchase Order.

I need is that after i select a PO in the combo box, ONLY the records of the
table with that PO number appear in a subform.

PO #
1
2
3


PO# Material Price
1 Paper $5
1 Pencils $1
1 Ruler $3
2 paper clips $2
2 notebook $1
3 mousepad $3
3 eraser $0.5

So, when i Select the PO # 2, i need to show on the scren (a subform
maybe?), all the items belonging to that PO.

This is just for consulting, i don't need to save the info.

Thanks a lot

Mike
 
Top