Solved

Why datasheet view form shownig all records?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

911 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

24 Experts available now in Live!

Get 1:1 Help Now