Invalid Field Name Access Web App - ms-access

I have an Access Web App and I am currently trying to make an OnClick macro for a field on one of my views so that when it is clicked, it will pop up another view to a specific record. Currently, my Where clause reads Where: [DistrictID]=[Districts].[DistrictID]
When I go into the App and click on the field with the macro, I get a pop up stating "Invalid field name 'Districts.DistrictID'."
The one and only site I could find that mentioned this error is: http://blogs.technet.com/b/the_microsoft_access_support_team_blog/archive/2014/08/04/access-app-invalid-field-name-lt-tablename-gt-lt-fieldname-gt-error-when-using-where-clause.aspx
This site says that it is due to case-sensitivity of the Where clause. My case matches my table/field exactly (I program in other languages, so I always match case just out of habit). I have quadruple-checked my spelling anyway, and even went so far as to copy-paste the field name into my Where clause. Still I get the error.
I have another view that does something similar with a different table/view that works perfectly (Where: [ContactID]=[Contacts].[ContactID]).
Does anyone have any idea why my Where clause is not working, or what I could be doing wrong?
Extra info if needed:
I would include photos, but the information in my database is sensitive, so I will do my best to describe the information in question:
I have 10 tables in the database. "Districts" is the one I am trying to work with. The Districts table has... quite a few fields, including DistrictID, DistrictName, EmailService, SpecialComment, and more. These four however are the fields being queried for the datasheet view which contains the macro. The OnClick macro is triggered for the SpecialComment field - when clicked, I want my District List view to pop up to the same district whose SpecialComment was clicked on (the Special Comment can run long sometimes, so if it is cut off by the size limit of the datasheet, I want people to be able to read the rest of the info without having to switch to another view and then find the district in the list). The District List view and the queried view both have the DistrictID field in the view, although it is hidden. I have tried unhiding the field in both views and it did not solve the problem - I had other Where clauses that used the DistrictID field before this that worked fine, so I doubted it would change anything anyway. Those Where clauses from before were substituted for other functions, so I don't have them to refer to to see why that one worked and this one does not.

If the view you are trying to open using OpenPopup macro action has a saved query as it's record source, then you must use the query name like this:
[FieldNameHere]=[NameOfQueryHere].[FieldNameInThatQuery]
If you are using a table name, then substitute the actual table name in the appropriate spot.
One thing to note which sometimes trips people up is that this technique won't work if the view you are trying to open uses an Embedded Query as its record source. The reason for this is you have no way of knowing what the embedded query name is that Access creates behind the scenes for the Access 2013 web app view. (It's actually a GUID name behind the scenes.)
I even had to add a special troubleshooting note in my book on this since I knew people would get tripped up on this (Page 584):
TROUBLESHOOTING
Why do I get an error trying to use a Where clause with an OpenPopup or ChangeView action when the view is based on an embedded query?
Access Services requires the Where clause to include the table or query name on which the view is based. When you define an embedded query as the record source for a view, Access Services creates a hidden system query that is not visible in the Navigation pane. Therefore, you cannot use a Where clause with the OpenPopup action or ChangeView action to open a view based on an embedded query. To work around this limitation, you can base your view on a saved query object. Note that Access Services creates a hidden system query as the record source also for Summary views. This means that you cannot use the Where clause argument to open a Summary view to a specific record or set of records. However, the workaround mentioned above won't work for Summary views.

Related

How to create table in access that is only visible in the query tools of a report?

I am trying to mimic an odd table titled "BinCalcInfo" that I have found in a MS-Access that appears to only be located in the relationships of the query tools of a report. I would like to duplicate this table in another database.
So when I first encountered this table I tried to look in the "All Access Objects" under tables. I assumed that all tables in the database would be enumerated here. However it is not. The only place to find the table is by opening the report into design view, navigating to the "query tools" where it shows the source of all of the relationships and source of all of the fields on the report.
In the graphic area where it shows all of the tables and queries being utilized there is an extra table/query (not positive which) that does not appear anywhere on the list of tables or queries possible to add.
I suspect that there is a way to create a temporary table for a specific report, I just have no idea how to implement it or what to search to find direction.
The first thing to check is whether or not the table/query has merely been hidden from the Navigation Pane. To do this, ensure that Show Hidden Objects is enabled within the Navigation Options:
Assuming that you're not referring to a table/query which has been set to be Hidden, the query is likely to be a subquery defined only within the SQL of the query and not saved as a separate query in your database.
For example, if you were to copy the following SQL into the SQL View for a new query, you would see a subquery called MySubQuery shown in the graphical Design View, but not represented by a corresponding saved query in the database.
select * from (select count(*) as MyCount from msysobjects) as MySubQuery
As such, if you needed to determine how your 'hidden' query is defined so that you may reproduce it, you should inspect the SQL for your query.

Use List Box with Multiple Selection in Query

Given I've created an Access Form with a ListBox; property > other > Multi Select = Extended; which permits multiple selections.
User selects multiple items.
Clicks a button that creates a report in "Print Preview"; but this report is based on the query, and the query is based on the values in the form.
This is accomplished by using this in the query when viewing in Access Query Design View (not SQL):
Like ([forms]![padc]![V2])
Where the form name is padc and the value to compare is V2.
Previously, rather than the ListBox that might show 10 options, V2 was just a field with one value. A user would either type a partial value, such as jack*, and the report would pull every instance where this value began with jack; whether that was jack, or jackie, or jacko, or jackson, etc. The LIKE part of this permitted the "fuzzy" logic bringing about varied results. The query would run, and the report would show all the records with anything starting with jack.
My goal, really, is to have a user select one, two or three, or all the available options in this box, and have the report respond correctly.
I believe the ListBox will let me do this, provided I have all the right names in the table that is the source of the options available to choose from.
I set the listbox to "multi-select" to enable multiple selections on the form.
The form is happy. It can let me click/highlight one or several items from the list.
The query is not happy.
For the field V2, neither
Like ([forms]![padc]![V2])
nor
=([forms]![padc]![V2])
Will retrieve records to populate the report; regardless of whether or not just one value in ListBox is selected or multiple values. (Like = fuzzy, and = means exact match.)
Neither work.
Of course, if the query won't perform, then the report won't perform either.
How can I write the correct query in Access, using "Query View = Design View" and or SQL to get this to function properly?
If the answer is "it can't be done without using VBA" then please point me to the VBA solution that a 5-yr old can understand, because I have zero experience using VBA.
Folks have recommended I use VBA; specifically that I should incorporate the "IN() IN function" in some manner; but I don't comprehend this solution at all.
I admit to being ignorant; not stupid; but ignorant.

MS Access Form Debugging

Hello I have a pretty intricate Access database. I just jumped on this project and have never used Access. I have a form that is generating a value entry popup when I try to run it and it shouldn't be. The problem is the form is trying to access a column of a table which has been changed recently. I just have no idea where to find the query or what exactly is trying to access that column. Any help greatly appreciated. I am using Access 2016 also.
Sounds to me like the problem inst actually your form but the query your form is based upon.
This may be a separate query or a query built in your forms record source.
Go to your form in design view. Open up the property sheet. (Under design tab) make sure the dropdown box has Form Selected and look at the Record Source.
The record source may state a query name, In which case you should remove the field/replace the field with another in that query.
Or if it says something along the lines of "Select ......" then just alter that query to not have the field you have removed/renamed and the problem should go away.
However it is worth noting that if you have sub forms it could be the record source of one of those.

Filemaker report

I am presently converting an access file to a filemaker solution and very new to filemaker.
In Microsoft access, I have a report that displays the output of a query which in turns queries information from a table. How should I build that in filemaker?
FileMaker is different in that views (called layouts in FileMaker), which display query results, are defined prior to use. For example, if you had a Customer table, and you wanted to find out which customers are in a specific city, you would would first create a new layout that displayed the fields you would want to see in the result, perhaps company name, city, contact person and phone.
Once you have the layout ready, you can either manually query the table directly in the layout using query-by-example. The specific steps would be:
From the View menu, choose Find Mode.
Click in the city field and type in the city you're searching for, ex. San Francisco.
Use the Requests menu and choose Perform Find, or just click the perform Find button in the status area at the top of the window.
A couple of points:
You can enter search criteria in as many fields as you like, result in an 'AND' search. For example, you could search for customers in San Francisco and that have a contact named Jorge.
To do an OR search, you need to add additional 'find requests' by using the Requests menu and choosing Add New Request.
In text fields, searches are by default 'begins with' searches. For example if you had a contact named Jorge, that contact would come up in a search for Jorge, Jor, or even J. If you need a whole word match, preface your criteria with =, ex =Jorge
Take a look at the search operators at the top of the screen where it says Insert: Operators. This option is only available in Find Mode. You'll find you can search for date ranges or wildcard characters, pretty much anything you need.
If this is a query you need frequently, such as a monthly aging report, the search can be encoded into a script and tied to a button, so that next time you need the report, you just push the button.
This is not really a programming question. Go To Layout mode and select Layout/New Layout Report from the menu. The wizard will guide you through generating the report. You will need to add a script to search for you data.
The best way to learn this is to create one of the starter solutions and see how reports work there
You can find a set of records using any layout that has the field(s) you want to search, regardless of its primary purpose. The found records will be displayed using that layout or you can switch to another layout, say a report layout.
After you have created ( or duplicated an existing Access layout ) the user can simply type Command+F and enter the city name in the city field. You can make this field a popup field in find mode to make it easier. Select or enter the city name and press enter.
Filemaker is so flexible that there are a great many ways to accomplish the Find but your users are probably familiar with entering the name in the report layout.
Always test your ideas with a number of users so as to keep them happy.

Lotus Domino NotesSQL ODBC & SQL 2008 query

I'm trying to work at getting the same information from a couple different sources but have hit a wall in trying to use NotesSQL and SQL 2008. What I am trying to do is to retrieve info from a couple different views on Domino servers. One view is a default view, the other is a created one.
One method I have used is Powershell, where I get the database, then select the view, get the first document & then iterate through the rest of the view grabbing fields that I need. The view I have selected is the People view.
I was trying to replicate this same thing using SQL 2008, using the NotesSQL driver, setting up an ODBC connection, and then creating a linked server to that Notes database. I am using the following query to select from the People view:
select * from openquery(MyNotesServer,'Select * from People')
However, what is returned from this view isn't what I am able to see when I use Powershell & then iterate through the documents returned in that view. Powershell shows 100+ columns in it, while SQL only returns 5 columns. Additionally, they're named "_12", "17" etc. Some fields (which may be custom, I don't know) have a meaningful name. Of the fields shown, I can select them by name ("_12", etc) but cannot select anything else. The number of rows (SQL) is the same as the number of documents in the view (Powershell $view.Allentries.Count).
Querying the view that was created (3 fields):
select * from openquery(MyNotesServer,'Select * from MyCreatedView')
returns all the fields in that view, and they are named as they are in the view.
In T-SQL querying the People view, how do you get the names of the columns that I know are there as I discovered in my Powershell script? They don't appear to be named the same thing, so how do you retrieve more than the 5 returned when you select * from the view? I have read through the Notes documentation & examples, but haven't been able to figure out what is mapped to where.
The reasoning behind this is wanting to utilize SQL & a notes.id file instead of running a script. Also, I want to make use of an already existing global view instead of views that may be accessible only to their author.
You can use select * from Person. Person is a form name, not a view name. Notes and Domino are not relational. The NSF file is a document database. The views in it are pre-built indexes that already have an implicit select. I.e., the "People" view selects all documents created with the "Person" form.
The above query bypasses the use of a view and will give you all the fields for all documents created with the the Person form.
Actually, come to think of it, the better query would be select * from Person where type='Person'. That's because the People view in Domino uses type="Person" instead of form="Person" in its selection formula. It is theoretically possible to have a document created with the Person form but with the Type field set to a different value. This variation will insure that you always get the same list that you see in the Person view.
But: In either case, it will be inefficient. The NotesSQL driver will have to do a full database search instead of simply reading the index of an existing view. It's going to search using the Notes formula SELECT Form="Person" & Type="Person". I really cannot recommend this, unless you are querying against a small Domino Directory database.
The best practice is to create a view containing all the fields that you really need, and do your query against that view.
First, in the Lotus Notes documentation, you'll find "columns" when you read about views, not fields.
Second, the columns have configured an option called "Programmatic Name". In that option, you can put an "alias". Lotus Notes puts values by default as "$12", "$17", etc. The thing is NotesSQL changes "$" by "_". That's the reason why you see "_12", "_17, etc.
How do you get the original names? As far as I remember (I don't have Lotus Notes near to make a verification) you can't. But, you can create another view with the columns with the data you need, and put appropiate names. The easy way to do it is copy/paste the view, delete the columns you don't need, and change that you want.