Subform issues with combo box

  • Thread starter gmazza via AccessMonster.com
  • Start date
G

gmazza via AccessMonster.com

Hey there,
I have a form and a subform based on the same table.
My table has 4 fields as the primary key.
These same fields I have as combo boxes on my main form, and the rest of the
fields in my table are in my subform.
My combo boxes all work nice with eachother, thats not my problem.
After my combo boxes get updated, nothing is showing up in my subform.
The query for my subform is based on the choices in the combo boxes on the
main form.
ie: The criteria for the key fields say Forms!FormName!comboName
The master child fields are the 4 key fields.

Can anyone help me as to why this is not working?
 
J

John W. Vinson

Hey there,
I have a form and a subform based on the same table.
My table has 4 fields as the primary key.
These same fields I have as combo boxes on my main form, and the rest of the
fields in my table are in my subform.
My combo boxes all work nice with eachother, thats not my problem.
After my combo boxes get updated, nothing is showing up in my subform.
The query for my subform is based on the choices in the combo boxes on the
main form.
ie: The criteria for the key fields say Forms!FormName!comboName
The master child fields are the 4 key fields.

Can anyone help me as to why this is not working?

Try Requerying the subform in the AfterUpdate event of each combo box.

Having a form and subform based on the same table would be very unusual...
why? Also, be sure that the combo boxes are UNBOUND, if they're being used to
select records; otherwise you'll update the bound field in the current record.
 
G

gmazza via AccessMonster.com

Thanks for your reply.
I already had the combo's after update requerying the subform so that didn't
work.
All the combo's are unbound.
Honestly I was just trying it this way because when I didn't use a subform I
still ran into the same problem. On having just 1 main form, the records
showed up, but did not do what my combo boxes said.
I am at a loss of what is going on here.
Hey there,
I have a form and a subform based on the same table.
[quoted text clipped - 9 lines]
Can anyone help me as to why this is not working?

Try Requerying the subform in the AfterUpdate event of each combo box.

Having a form and subform based on the same table would be very unusual...
why? Also, be sure that the combo boxes are UNBOUND, if they're being used to
select records; otherwise you'll update the bound field in the current record.
 
G

gmazza via AccessMonster.com

In my subforms query I even substitute the criteria of the field on the
subform and instead of using the criteria of the combo box on the main form,
I use the actual values in the table and the query shows the result. I run
the form and it shows the result.
For some reason it is not grabbing the values from the combo boxes and using
them, it makes no sense.
Thanks for your reply.
I already had the combo's after update requerying the subform so that didn't
work.
All the combo's are unbound.
Honestly I was just trying it this way because when I didn't use a subform I
still ran into the same problem. On having just 1 main form, the records
showed up, but did not do what my combo boxes said.
I am at a loss of what is going on here.
[quoted text clipped - 7 lines]
why? Also, be sure that the combo boxes are UNBOUND, if they're being used to
select records; otherwise you'll update the bound field in the current record.
 
J

John W. Vinson

Thanks for your reply.
I already had the combo's after update requerying the subform so that didn't
work.
All the combo's are unbound.
Honestly I was just trying it this way because when I didn't use a subform I
still ran into the same problem. On having just 1 main form, the records
showed up, but did not do what my combo boxes said.
I am at a loss of what is going on here.

Please post the SQL of the subform's recordsource, the Master and Child Link
Field properties, and your code.

I agree that this should work with one form (by setting the form's Filter
property based on the combo boxes, for one way) without the need for a
subform.
 
J

John W. Vinson

In my subforms query I even substitute the criteria of the field on the
subform and instead of using the criteria of the combo box on the main form,
I use the actual values in the table and the query shows the result. I run
the form and it shows the result.
For some reason it is not grabbing the values from the combo boxes and using
them, it makes no sense.

Post the RowSource and Bound Column properties of the combos as well - it may
be that the value of the combo isn't what you think it is!
 
D

David W. Fenton

Having a form and subform based on the same table would be very
unusual...

A table that uses a self-join to create a hierarchy of related like
entities?
 

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

Top