Strange subform-problem

J

Jan Gosch

Hello

I'm having troube with a subform/form I do not really understand
The subform is linked to a listbox in a form. you select something in a
listbox and a query the subform is bound to selects the records based on
the listbox.

something like
select * from tblP where pId = forms!frmMain!lstboxselect

the query run alone with frmMain open works fine but the subform doesn't
show any records.
And now the strange thing.
When i clik 'Filter by selection' for the subform it shows all the records
in the table but no entrys in the fields, now I uncheck the filter again
and the subform shows all the records as expected. What is going on here?
Alle the Allow-Properties for the form are set to yes.

Using Windows98 SE and Access97

Any help is greatly appreciated

Jan
 
M

Marshall Barton

Jan said:
I'm having troube with a subform/form I do not really understand
The subform is linked to a listbox in a form. you select something in a
listbox and a query the subform is bound to selects the records based on
the listbox.

something like
select * from tblP where pId = forms!frmMain!lstboxselect

the query run alone with frmMain open works fine but the subform doesn't
show any records.
And now the strange thing.
When i clik 'Filter by selection' for the subform it shows all the records
in the table but no entrys in the fields, now I uncheck the filter again
and the subform shows all the records as expected. What is going on here?
Alle the Allow-Properties for the form are set to yes.

It sounds like you forgot to Requery the subform in the list
box's AfterUpdate event:

Me.subformcontrol.Form.Requery
 

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