ListBox Problem - Urgent help is needed

G

Guest

I’m having a very weird problem - Access 2003. I have an unbound form where
I set the recordsource programmatically. This works fine. On the form is a
listbox where the rowsource is set programmatically as follows:

strSQL = "SELECT CTL_ID, Control, Type, CkDte, StartDte, " _
& "HrsMin,, HRS_TEMP, Time FROM qryRCtl " & "WHERE RT = """ & Me.RT & """"
Debug.print strSQL
Me.lstControl.RowSource = strSQL

There should always be 6 records displayed in the listbox. I have
pre-exiting data where this works and displays the 6 appropriate records.
I’m redeveloping the database and am testing as I go. When I add new data
through a different form (adds the 6 records to the Control table) – only 4
records will display in my listbox. The RT value in the Control table is the
same for all 6 and when I filter on the table using the new RT value, it
displays the 6 records. When I test the SQL statement in a new query though
– only 4 will display. Nothing appears to be wrong with the statement and
always excludes 2 specific control types.

I have decompiled, compacted/repaired and imported all objects into a new
database – nothing has helped. I hope someone can help me!

Thanks
LeAnn
 
G

Guest

Ok I feel dumb! The underlying query had a type table liked to the other
tables and I had modified the name of 2 of the controls when inserting into
the control table. Of course they didn't match the Type table.
 

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