InfoPath 2010, read & write to Access 2010 - ms-access

I have an InfoPath 2010 form that I've created to submit data into an Access 2010 database. One specific element being captured is an employee ID. So, the database may have multiple records of the same employee ID.
I have a second table in the database, that contains every employee ID in one column and their name in another.
If the user is creating a record for employee ID 987, how do I add a textbox to this form that will read the corresponding name found in table 2?
Thank you,
Jeff

Here I am using this procedure in fetching data from list. Try whether its working for Ms Access
If you need to fetch data using infopath2010 then use following condition
In the Rules add Action
Under Run these action add Set field value
In field box select where fetch details wand to display (i.e which txt box)
Click Calculted value (fx) in value
In that click insert field or group and select Show advance view
Under field select which table you need to fetch the data
Select the field which you need to display in the selected txt box and using filter condition filter the data using secondary table employee id= employee id in main field
Secondary table will visible in infopath form only if you get connected with that using manage data connection in infopath

Related

Cannot add record(s); join key of table not in recordset in MS Access

I'm new to access, and I have been able to find a solution for most of the hiccups I have experienced with MS Access, but I cannot get a combo box in a form to function properly.
I have tried unbounding it, but then it does not update the corresponding field in the query the form is based on. I have tried to bound it to the EmployeeID, but then cannot select the Employee in the combo box because EmployeeID is an autonumber field.
If anyone can offer me any advice on how to get this to function properly, it would be greatly appreciated. Also, the basic intent of the form is to allow an employee to select their name, enter a date, and check the appropriate boxes. All of the other values function properly, but I do not want the Employee table to change every time a maintenance log is created weekly...
I hope I explained everything well enough. Attached below is a copy of the database.
Maintenance Log Database
You have to set up the combo box with a row source that contains both the Employee ID and the Employee Name. Use Employee ID as the bound column. Then in the display properties set columns to 2 and column widths to 0;1 (assuming you set your row source so that Employee ID is column 1 and Name is column 2).
This way your combo box displays the name but it actually binds to and uses the ID.

Access 2013 Web App Filter Combo box value based on other field

I am modifying an Access 2013 web app.
I have a combobox (lookup field with user entered list) in List form view.
Now I need to filter values in this combobox based on other field. The other field is in the same table as text field.
I need to filter values in combobox if that other field is null or not null.
I have tried to create a table for combobox, I have also tried to create a query with parameter but from list view when I select query for my combobox I couldnt pass parameter.
When I select table it brings whole table which is same as entering values.
Let me know if you know any work around.
Thanks
In a similar similar scenario I was able to make query that filtered the table and then I added a new combobox the row source should be the name of query and bound Field should be the name of the column

Access 2010 - display related record in a form

I have 2 related tables.
Invoice (fields: number, buyer, supplier, etc.)
Company - all buyers and suppliers (fields: name,etc.)
Buyer ans supplier fields on invoice are referencing same field (company_id from company table)
On invoice form, I choose supplier ID from dropdown list and also buyer ID from dropdown list.
Task: To make the form little bit readable, I would like to automatically display a name of company after selecting company id in both fields.
What I did:
I manually dragged the company name field to the form and wizard asked me which field I would like it to connect to (byuer or supplier), so I got 1 field working. How to create another field that shows company name? If I drag another instance of company name, wizard does not show so I can set it up and I can not find anywhere setting for that. Thank you for help.
I think the best way is the following:
Create a lookup query: Create a new query similar to this “SELECT CompanyId, CompanyName FROM t_Companies ORDER BY CompanyName;” and save it as “ql_Companies”
Edit your Invoice table. For both your fields Buyer and Supplier do the following: Click on the field and select Lookup in the filed properties. Set the following properties: Change Display Control = Combo Box, Row Source = ql_Companies, Column Count = 2, Column Width = 0;5 and save the table.
Now when you create a new form based on your Invoice table the field will be automatically shown as a combobox.
You can also do all this manually on an existing form but then the combo box will only show on this one form. If you prepare the underlying table with lookup queries then this will work in all queries and forms automatically without additional work.

How to select multiple records and change their value at once

Here is my problem and I do not know where and how to start to search about this.
In a MS Access database users will have a list of records returned from a query. Let's say employees which are active (employed). This table has a related table let's say departments (related through departmentID in both table).
What I want to do is to make form (or something else which would do the same job), where user will select some records (probably with checkboxes associated with each record) and there will be a single combobox with department names. When user selects a department name, its departmentID should be saved into departmentID field of these records.
I have created a form with a query of active employees (form with multiple items). And put an extra field in Detail section with a checkbox. In Form footer I have a combobox with Department names and IDs (not shown to user), and a button to save values.
I have to now figure out, how to select all rows/records with a checked checkbox and update them. I am by the way familiar with VB and SQL.
I would appreciate any idea/knowledge on how to solve this.
An extra field in the Detail section won't help you if you don't link it with a data field in the displayed table. If you can do that, then you have simply to make a VBA function to update all selected rows, and refresh the recordset.
If you cannot modify your table, you'll have to create a new table with just the key columns of your master table, and manage it via VBA. Better to use the first option if you can, it pollutes your schema, but in most cases that won't be a problem for an Access database.

Can I use a combo box to change the table a form saves data to in MS Access 2010?

I have created an MS Access form to insert data to tables. I want to store data to separate tables.
How can I use a combo box in the form to select the target table in each entry.
Yes they are identical.
As an example, I enter details of people using a form(name, age, sex).
Then I want to generate two tables automatically according to sex(male and female).
One table for males and other table for females.