Solved

Why datasheet view form shownig all records?

Posted on 2014-02-18
4
580 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

735 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