Solved

Why datasheet view form shownig all records?

Posted on 2014-02-18
4
564 Views
Last Modified: 2014-02-19
I have a form opening in datasheet view mode.  When it opens it shows all of the records even though if I run the recordsource query it only shows those records selected via...

Like "*" & [Forms]![frmSelectLocationForReconcileInventory]![cboLocation] & "*"

in the RecordID field criteria.

The query is fine.  It only shows the records I would expect to see.

The report isn't fine.  It's showing all of the records.
0
Comment
Question by:SteveL13
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
ID: 39868600
Dumb question: at the time you tried this, what is the actual value of [Forms]![frmSelectLocationForReconcileInventory]![cboLocation]?  If it is blank, then your Like expression will match, well, everything :)
0
 

Author Comment

by:SteveL13
ID: 39868660
It is a number value coming from a combobox on a form where the user can select the Location before they click a command button to open the form in question.  Like I wrote, the query when run by itself shows just the records I would expect to see.

The form is showing all of the records.  The query is the record source for the form.
0
 
LVL 26

Expert Comment

by:Nick67
ID: 39869150
There are many, many ways of squirrelling up a  recordsource using VBA.  You can code it in the Open event.  It is also possible to squirrel a query's SQL property, re-writing it on the fly.  Is the form's record source REALLY what you think it is?  Or is some code re-writing it?

So, as a test, use a wizard to create a report using your query as the record source.  Does this new, throwaway report exhibit the same problem.

"it only shows those records selected via..." is that hard-coded into the actual query itself (mmm, I'm thinking not, but maybe) or is it an applied filter (maybe so)  If it is a filter, then FilterOn = True will need to be coded in as well.

Datasheets are also screwy items, at times they don't obey the same rules as other views in regard to events, and I never let my users have one.  Does the problem manifest if the form is set to Single Form or Continuous forms?
0
 

Author Closing Comment

by:SteveL13
ID: 39870774
Your solution let me to find that I had the criteria in the wrong field.  Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

747 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

9 Experts available now in Live!

Get 1:1 Help Now