Navicat for MySQL - How to copy fields name quickly? - mysql

In phpMyAdmin, I can highlight any fields name quickly to copy and paste it in the script (eg: php files)
How do I do same process in Navicat?

Method 1:
Right click on the table name. Click "Design Table". In the columns tab, click column name header or use Ctrl/Shift to multi-select the fields you need to copy and Ctrl+C.
Method 2:
After 3 years, upon more usage of the software I found this:
In the result grid of any query, highlight one whole row, or only the columns you want (with Ctrl/Shift key pressed to multi-select), right click on highlighted area. In the context menu select
Copy as > Tab-split field name
Mind that my software is in Chinese so I translated it. Your GUI may look different but you get the point. Also the option is there for Navicat Premium. I don't know if other editions have it.

Related

Access combo box for DB mapping table 2-1 Table relation

I've run into a bit of a snag with a project I'm working on, and being new to Access I don't know if what I want to do is possible without VBA. I've looked around but all I can find are answers related to showing multiple columns, not controlling multiple fields in my DB.
To paint a picture I have a mapping system set up in my DB to help me distinguish the name and type of data is held in a table.
The setup is as follows:
-Data table is "LineItems" with an ID and the line data (think typical excel format)
-Mapping table is "LineItem_Mapper" with LineItem_ID, DataType, and Entity_ID
-A helper table "Data_Type" with ID and Name
-two "Entity" tables with differing properties both have ID and Name
The reason for the split is on data type is that the two types of data behave differently. One type has a parent child relation, and the other is a standalone row. I want to preserve this structure in my DB and feel I have done so with this mapping.
Now, on to the issue I'm running into. In my Access data entry form I want to use a combo box, as the options a user may chose for each line when entering are finite. However, this combo box is affecting the Mapping table above. I have been able to populate the box with my desired list with a custom query built from my 2 entity tables, but I don't know how to get Access to create or update the Mapping table using this box.
what I want to happen is when I chose something in the box, a line is created (or changed) in the mapping table with all 3 columns being populated. first the LineItem_ID for the line I am populating, and then the DataType and Entity ID to reflect the proper mapping.
Can Access do this on its own? Or do I need to do this with VBA?
As requested by the OP converting my commend as an answer (with a little bit more detail):
By far your best option is to use VBA. I doubt there is another way and even if there is it would be so convoluted it would be unworkable and unmanageable.
This should get you started:
In the combo box properties go tot the events tab and in After Update or On Change (look up the difference between the two events to see which behavior you prefer) click the down arrow and select [Event Procedure], then click on the … button. This will create a VBA module for you complete with the function that runs when the selected event is triggered.
You can use DoCmd.RunSQL "[Access SQL INSERT statement]" to add records to tables.
You can use Me.[MyComboBoxName] to get the current value of the combo box. Similarly the value of anything else in your active form.
You can use DLookup to get the value of any record in your tables.
Hopefully these will give you a relatively quick start.

Excel Data Model without using PowerPivot

I have a question about the "Data Model" in excel. Whenever I read about this function, it is used with PowerPivot.
I ask because I would like to do something like this:
I have table A:
ID
info1
And table B:
ID
info2
Now if I connect these tables with with the data model function (through the ID-Column), I thought that I could then join tableB.info2 to tableA and have a table that shows ID,info1,info2
But that doesn't seem to be possible, or is it possible and I'm doing something wrong?
Is there ANYTHING you can do with datamodels without using PowerPivot? I feel like I'm missing the point of this feature.
Since Excel 2013 onwards, the DataModel CAN be used without PowerPivot. You can load tables (or other data sources) into it, and you can even add measures using DAX (although you can't add Calculated Columns). Check out the following links for examples:
https://youtu.be/FVVK-8QZC1M (Mike Girvin shows you how to use DAX without PowerPivot to create measures for PivotTables based on the Data Model)
https://blog.crossjoin.co.uk/2012/07/16/what-are-the-big-changes-in-excel-2013-for-bi/ (Read the comments to understand how the DataModel has been made completely separate from PowerPivot. In effect, PowerPivot is just a UI that lets you do things to the DataModel)
https://powerpivotpro.com/2014/07/adding-tables-to-a-model-from-vba-in-excel-2013/ (Dany explains how you can do stuff to the DataModel using VBA)
http://dailydoseofexcel.com/archives/2017/07/10/look-ma-no-powerpivot/ (My post, covering the above)
PowerPivot is a highly advanced tool that takes the hassle out of tables. It saves you a whole lot of time.
The "Data Model" is at the "core" of PowerPivot, PivotTables, and PowerView, and cannot be used apart from either of these three tools.
What you're talking about can be achieved, but is best handled in a VLOOKUP or INDEX(MATCH()),
But let's just say we want to go down that route, because honestly I do sometimes.
First,
Hook up your ID values in your data model between table 1 and table 2, the arrow flowing towards table 1 that only has info1.
Create a calculated column in table1, give it the formula
=RELATED(table2[info2])
Name that new column you just added "related info2"
And your value populates magically.
But how do you get it back into your excel workbook? It's not at all a "clean" solution, which is why we recommend VLOOKUP or MATCH(INDEX())
What you'll want to do to bring your info2 into your excel sheet is use a "Flattened PivotTable".
You can create this type of PivotTable in your PowerPivot Editor, by pressing the "PivotTable" button.
Put your Flattened PivotTable right beside the other table in your Excel worksheet that you want info2 at, like you're magically going to populate the info2 column right beside it, because you're about to.
Drag and drop all PivotTable fields from the table that contains our calculated column to the "rows" box, including that "related info2" column we just created in table1.
To get the right values on the right rows, go into your Design tab, and click on the "Subtotals" button, disable all subtotal, and do the same with the "Grand Totals" button, disable all grand totals.
Make sure your "Report Layout" is "Compact", also found in the Design tab.
Optional: You can add a field to "values" to allow row formatting to recognize the rows, otherwise the PivotTable thinks that there are no rows and you won't get anything but a mostly solid color, no matter how many designs you try to switch to (we're doing something tricky, remember?)
Now hide all the columns in your excel sheet you just created with the PivotTable except your "related info2" column.
So yes, it is possible to do, but you're better off with a VLOOKUP or INDEX(MATCH())

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.

Microsoft Access - Create Form to Post Data to Intersection Table

I am sincerely sorry if this question has been asked before, however with my limited knowledge of using Microsoft Access forms I am having an issue that is likely a very simple fix.
At the moment I am trying to create a form that will allow me to post data into an intersection table using combo boxes, the purpose is to create a relation between Clients and Project Numbers, these are intended on being a Many-to-Many relationship.
Relation Example
To begin with one issue I am running into is that when I use the intersection table to select a unique Client Name I get multiple entries from the drop down menu when there are multiple items in the intersecting table.
Form Example
The second part of my issue is that I am unsure how to post data to the intersecting table once the dropdown selections have been made.
Any help is greatly appreciated, and I thank everyone for their time.
The first part is to create a form in which you find, and edit data in the main client table.
This form will ONLY be based on the single main client table.
You perhaps ALREADY have a nice form to edit the client table anyway. I mean, how else will users find and edit a client anyway? So this issue and problem will LONG be dealt with before you do anything else of use in the application.
The form based on this single table might look like this:
Ok, now close the above, and create a second form to allow adding some choices of favorite colors (or in your case ClientContract). So the form will be based on this child table.
Again, like the first form, this form is based on ONE table.
Make this form continues, so click on ClientContract table, and then from ribbon choose multiple items form from the ribbon. It will look like this:
Of course we don’t want the user to have to manually type in the color (or project in your case), so we drop in a combo box from the ribbon and use the wizard. MAKE sure the first column of this combo is the PK of the ProjectNumber table, but FOR EASE of reading and selection, include ProjectNumber and Project Description columns in that comb box. NOTE in above how I also had added that combo box.
Assuming you closed and saved this form.
Now open our first main client form in design mode, and drag + drop in the continues second form we just created onto this form. The resulting form will look like this:
Access will automatic set up he customer_ID for us (because it is a sub form attached to the main form that only displays the one main record).
Once the above works, then again close the lot, and open up our continues form in design mode and remove all the extra junk.
(leaving ONLY the combo box).
The result is this:

Invalid Field Name Access Web App

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.