Can we refresh the Data Sheet in Access 365 based on a value selected in Drop Down List? - ms-access

I am trying to have a simply access forum to update the data in Data Sheet view via Form. I have a Table with say 4 Fields. For the sake of explanation.
City
Population
Hospital_Name
Active_Patient Count.
In the Form - I have two controls
ComboBox - It fetched Distinct list of City from Table (only 1 table)
Data Sheet of the Table
Objective -
Allow users to choose the City from the Combo Box control, which should refresh the Data Sheet with only Rows where City = selected value in Combo Box.
Allow uses ONLY to update only one column in Data Sheet view - which is Active Patients.
Any leads / help will be great.

Related

MS ACCESS 2007 - Selecting Value from Combobox in Subform creates a duplicate value

I am creating a sales database for a small charity in MS ACCESS which should allow a salesperson to enter a Sale and then pull reports etc.. The entry form for the sale (testsales) should create an entry in the sales table. This table has a foreign key for the agency table which in turn stores all the referral agencies we work with.
I have put the combobox for the agency name selection in a subform.
Unfortunately each time I save a sale with a value in the combobox selected, the dublicate value is added to the agency table.
Thanks in advance
Database relations
Salesentry form with subform
If there is anything I should add please let me know.
In your case you can use only combobox or listbox with source of rows from query instead of using subform.
You will have to query AgencyID and AgencyName, make the Bound column AgencyID (1 if you query AgencyID first), but set the width of AgencyID in combobox/listbox to 0 to not show it for users.

Split form columns not displaying correct value

I have a split form set up in Access 2007. In it, I have one combo box to select a school, and the After Update event for this combo box populates a second combo box.
The second combo box selects an item of equipment, and the query associated with it selects all equipment located at the selected school, unioned with the currently selected piece of equipment. (If the school selection changed, the box would turn blank, but actually still hold a value, so I unioned it with it's own current value)
Anyhow, the issue is that the equipment column in the split view only shows equipment values that are associated with the currently selected school as well. For example, if I have a form with schoolA and EquipmentA selected, only equipment also associated with SchoolA will appear in the Equipment column of the split form data sheet. If I change the School column to SchoolB, any rows that were populated with equipment associated with schoolA disappear, and equipment on rows associated with schoolB now show up.
Interestingly, if you click on the school column of the data sheet, this also will update the equipment column to only show equipment related to whatever school was in that row.
To summarize: changing the value of one field in my split form will change what data is displayed in the data sheet portion of the form. Clicking on the fields column in the data sheet has the same effect.
I had the same issue, as you describe. I used a workaround (i.e. used different control instead of split-form)
My Situation:since In the split-form, I was just showing the records, and not allowing users to edit the records in split form. Users could click on any record in split form, which would show in main form, and then could edit. The main purpose of this form was for the users to be able to search for the data in split form and then select and edit.
My workaround : Created a form, where I used text boxes to search, and a list view to show all the columns which were in the split form. On double click event, I added Open the form filtered with the record which was double clicked.

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.

InfoPath 2010, read & write to Access 2010

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

access combo box on a form to display text values from table/query and save the associated ID value in the table on my form is already based on

My project is a form based on a transaction table, this form has four combo boxes. Basically all of them are storing ID values, and the question is how to make access display the associated value of the ID on the form, while the ID# is being stored in the table.
Example: one combo name is well_ID on the form, which will be populated from the table (Wells) by select staetment [SELECT Wells.Well_ID, Wells.Wellname FROM Wells]
i need the combo to display the well name and store the well_ID in the table.
Would you please help on this.
Regards
Mohamed
The easiest way to do this is to use the wizard and let it guide you through. Create a form based on a table or query, ensure the wizard button is clicked, add a combo and follow the steps provided by the wizard.
You will end up with something on these lines:
Row Source Type : Table/Query
Row Source : SELECT Wells.Well_ID, Wells.Wellname FROM Wells
Bound Column : 1
Column Count : 2
Column Widths : 0cm;2cm;
If you choose to store the value in a field (column), you will need:
Control Source : SomeID
Which refers to the field or column on in the table or query bound to the form and takes its contents from the Bound Column, which can be any valid column number, starting from one (1). In other words, what ever field in that table that should store Well_ID.
The Row Source can be a more complicated SQL string, a query or table. It can refer to other controls on any open form. These properties can be set by code.