Solved

Why datasheet view form shownig all records?

Posted on 2014-02-18
4
588 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

623 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