Export SQL Data to Excel Dropdown - sql

Is it possible to export records from SQL directly to a drop down data validation list?
I want to export data directly to the list without having to actually have the data saved within a sheet/table etc.

Step 1: Add a query data connection
If you do not have an existing query data connection that you can use on your form template, follow these steps to add a secondary data connection to your form template that queries data. If your form template already has a secondary data connection that you can use, you can skip this section and go to Step 2: Configure the control.
On the Tools menu, click Data Connections.
In the Data Connections dialog box, click Add.
In the Data Connection Wizard, click Create a new connection to, click Receive data, and then click Next.
On the next page of the wizard, click Database (Microsoft SQL Server or Microsoft Office Access only), and then click Next.
On the next page of the wizard, click Select Database.
In the Select Data Source dialog box, click New Source.
On the next page of the wizard, in the What kind of data source do you want to connect to list, click Microsoft SQL Server and then click Next.
In the Server name box, type the name of the server that contains the SQL Server database.
Under Log on credentials, do one of the following:
If the database determines who has access based on the credentials used in a Microsoft Windows network, click Use Windows Authentication.
If the database determines who has access based on a specified user name and password that you get from the database administrator, click Use the following User Name and Password, and then type your user name and password in the User Name and Password boxes.
Click Next.
In the Select the database that contains the data you want list, click the name of the database that you want to use, click Connect to a specific table, click the name of the primary table, and then click Next.
On the next page of the wizard, in the File Name box, type a name for the file that stores the data connection information, and then click Finish to save these settings.
If you plan to use other tables in the query data connection, you can add the other tables in this page of the wizard.
Add other tables
Click Add Table.
In the Add Table or Query dialog box, click the name of the child table, and then click Next. InfoPath attempts to set the relationships by matching field names in both tables. If you do not want to use the suggested relationship, select the relationship, and then click Remove Relationship. To add a relationship, click Add Relationship. In the Add Relationship dialog box, click the name of each related field in the respective column, and then click OK.
Click Finish.
To add additional child tables, repeat these steps.
Click Next.
To store the results of the query with the form template, select the Store a copy of the data in the form template check box. Selecting this check box stores the query results in the form template. Becuase the data is stored in the form template. the data is available in the forms that users fill out, even if their computers are not connected to a network.
Security Note: Selecting this check box stores the query results in the form template. Because the data is stored in the form template, it is available in the forms that users fill out, even if their computers are not connected to a network. If you are getting sensitive data from this data connection, you may want to disable this feature to help protect the data in case the computer is lost or stolen.
Click Next.
On the next page of the wizard, type a descriptive name for this secondary data connection. If you want the form to automatically receive data when the form is opened, select the Automatically retrieve data when form is opened check box.
Step 2: Configure the control
If the form template has multiple views, click View name on the View menu to go to the view with the control where you want to display the data from the secondary data source.
Double-click the list box, drop-down list box, or combo box control that you want to populate.
Click the Data tab.
Under List box entries, click Look up values from an external data source.
In the Data Source list, click the data source that you want to use.
Click Select XPath Data Source button next to the Entries box.
In the Select a Field or Group dialog box, specify what data will be shown to the user and what data will be submitted to the external data source by doing one of the following.
Specify that the data the user will see is the same data the user will submit
Click a field, and then click OK.
Specify that the data the user will see is different from the data that the user will submit
Note: In this scenario, the data that the user will see is from one of the fields in the group, and the data that the user will submit is in another field in the same group.
Click a group, and then click OK.
In the Control Properties dialog box, click Select XPath Data Source button next to the Value box.
In the Select a Field or Group dialog box, click a field that contains the data that the user will submit to the external data source, and then click OK.
In the Control Properties dialog box, click Select XPath Data Source button next to the Display name box.
In the Select a Field or Group dialog box, click a field that contains the data that will appear in the control, and then click OK.
If the field in the Display name box has values with similar display names, and you want to display only unique names, select the Show only entries with unique display names check box.

Related

Need prompt to save changes in Windows form when changing displayed record

I am relatively new to programming, so this may be an easy one. I have a Windows form that connects to SQL Server and displays the data in a form where a user can edit and add or delete records (via databinding). The form works well, and has record navigation controls as well as context menus that allow the user to filter data on any field.
Currently, the user can make changes and switch to new records, etc... but changes are not applied until the user clicks the "save" button. However, I'd like to prompt the user to save records whenever the user navigates to a new record (either through navigator or through application of a filter which displays a different record).
What event can I use that will trigger whenever a different record is reflected in the form?
Thanks,
Jay

How to open an existing record in a form with a click of menu item in openerp?

I have created a menu item- 'Personal Profile'.
On click, it should open the candidate profile in a form view.
I have set rules so that each candidate can see only his/her profile.
In action part of the menu I have - defined view_type as form & view_mode as form,kanban
But,by default on click of the menu item a new form is opened for create.
Instead I want my existing record form view(i.e user/candidate profile) should be displayed every time when I click the menu item.
Please Help..
You need to save the user data in preferences (user defaults) or plist file,database any of these data source.
Than on click you need to check if data exist in these data source than fetch and fill out data in form or if no data exist than open blank form.

Combo box change value event

I have product that supports multiple databases. During installation I would like to have a combo box that contains all databases it supports. Also there is a text box where user can enter connection string. I would like to have connection string template for each supported database and when combo box is changes, I would like to show in text box connection string template related to selected database.
As Yan said this is not possible to do on one screen. However you could have the dropdown on it's own page and then after clicking next work out what the user selected by testing the property which is set and populate the textbox with the correct template.

How to edit a record through a form on MS Access?

I'm new to Microsoft Access and I'm having a trouble implementing something.
Basically, I have a form with a combo box, some text boxes, and a command button.
What I want to do is have the user select a record from the combo box, which then populates the textboxes (I've already managed to do this). Once the data has loaded into the textboxes, I want the user to be able to edit the info in the textboxes, then press the command button so that it updates that record in the table.
This looks like the same odd form where you had trouble with delete. It sounds like you are working from the wrong end. Create a form based on a table or query, then add a combobox to find records on the form based on the selection. There are wizards to guide you through. You will then have a standard Access form where everything works as expected. When textboxes are changed, the data will be updated as soon as you move to another record, there is no need for save, it is the default for Access.
If you wish to use non-standard unbound controls, you will need to update with SQL or stored queries.

How do I update the password for a Cognos Data Source?

The db password expired and it needs to be updated, how do I update the password for a Cognos Data Source?
In Cognos Administration, under Configuration tab, the Data Source Connections section (on the left):
Clicking on the Data Source name will bring give you the Connection for that Data Source (the Connection might have the same name as the Data Source). Clicking on that will bring you to the Signon (Which may also have the same name, it is an icon of a db with a user icon next to it). Choose properties of the Signon, on the properties page select the signon tab, on that page is an entry to "Edit the signon".