Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Why datasheet view form shownig all records?

Posted on 2014-02-18
4
Medium Priority
?
596 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 93

Accepted Solution

by:
Patrick Matthews earned 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
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: …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

927 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