Solved

Access form not showing all records in base table

Posted on 2004-08-19
7
1,209 Views
Last Modified: 2012-05-05
Loaded 229 records without any errors. All show up in table. However when open form only 143 records show up. Form is based on a query which select * from the table.
0
Comment
Question by:HKBoyz
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Assisted Solution

by:Dexstar
Dexstar earned 380 total points
ID: 11848785
HKBoyz:

SELECT * doesn't mean "Select all records".  It means "select all fields".  Are you doing a join or anything with any other tables?  Post the full text of the query so we can have a look.

HTH,
Dex*
0
 

Author Comment

by:HKBoyz
ID: 11848795
The form is based on this query, where t_requirements is the table where data goes to:

SELECT t_requirements.*
FROM t_requirements
WHERE (((t_requirements.Process_ID)=IIf([forms]![f_requirements].[option].[value]=99,[process_id],([forms]![f_requirements].[option].[value]))) AND ((t_requirements.Module_ID)=IIf([forms]![f_requirements].[option1].[value]=99,[module_id],([forms]![f_requirements].[option1].[value]))) AND ((t_requirements.Finsys_id)=IIf([forms]![f_requirements].[option2].[value]=99,[finsys_id],([forms]![f_requirements].[option2].[value]))))
ORDER BY t_requirements.Process_ID;

The conditions are for option group filtering purpose, where 99 = ALL.
0
 
LVL 4

Assisted Solution

by:naivad
naivad earned 120 total points
ID: 11848856
The WHERE clause is Filtering out some of your records.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 4

Assisted Solution

by:naivad
naivad earned 120 total points
ID: 11848890
OK...

I actually built the thing...

Check your table for NULL values, they wont show...if the value is 0 it works, NULLS do not work
0
 
LVL 19

Assisted Solution

by:Dexstar
Dexstar earned 380 total points
ID: 11849003
naivad:
> Check your table for NULL values, they wont show...if the value is 0
> it works, NULLS do not work

Good catch!

HKBoyz:

Try this:

    SELECT t_requirements.*
    FROM t_requirements
    WHERE ((((t_requirements.Process_ID)=IIf([forms]![f_requirements].[option].[value]=99,[process_id],([forms]![f_requirements].[option].[value])))
    OR ([forms]![f_requirements].[option].[value]=99 AND IsNull([process_id]) = True))
    AND (((t_requirements.Module_ID)=IIf([forms]![f_requirements].[option1].[value]=99,[module_id],([forms]![f_requirements].[option1].[value])))
    OR ([forms]![f_requirements].[option1].[value]=99 AND IsNull([module_id]) = True))
    AND (((t_requirements.Finsys_id)=IIf([forms]![f_requirements].[option2].[value]=99,[finsys_id],([forms]![f_requirements].[option2].[value]))))
    OR ([forms]![f_requirements].[option2].[value]=99 AND IsNull([finsys_id]) = True))
    ORDER BY t_requirements.Process_ID;

I think I got it right.  I didn't recreate it, that's just off the top of my head.

-D*
0
 
LVL 19

Accepted Solution

by:
Dexstar earned 380 total points
ID: 11849011
HKBoyz:

Maybe that isn't right.  I think it might need to be this:

    SELECT t_requirements.*
    FROM t_requirements
    WHERE ((((t_requirements.Process_ID)=IIf([forms]![f_requirements].[option].[value]=99,[process_id],([forms]![f_requirements].[option].[value])))
    OR ([forms]![f_requirements].[option].[value]=99 AND [process_id] IS NULL))
    AND (((t_requirements.Module_ID)=IIf([forms]![f_requirements].[option1].[value]=99,[module_id],([forms]![f_requirements].[option1].[value])))
    OR ([forms]![f_requirements].[option1].[value]=99 AND [module_id] IS NULL))
    AND (((t_requirements.Finsys_id)=IIf([forms]![f_requirements].[option2].[value]=99,[finsys_id],([forms]![f_requirements].[option2].[value]))))
    OR ([forms]![f_requirements].[option2].[value]=99 AND [finsys_id] IS NULL))
    ORDER BY t_requirements.Process_ID;

-D*
0
 

Author Comment

by:HKBoyz
ID: 11854277
Thanks, guys. All those columns are required so they all got values (ie. no null vlaues). My quesiton is: does the number of records ACCESS is showing at the bottom of the screen correctly reflect the toal number of records in the table? I thought I saw all the records ont he form, but the number is showing sth. different.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: Often, when running a query with joins, the results show up "duplicates", and often, those duplicates can be "eliminated" in the results using DISTINCT, for example. Using DISTINCT is simple: just add it after the SELECT keyword, an…
This article describes some very basic things about SQL Server filegroups.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now