MS Access need to hide fields based on linked combo box - ms-access

I have one table, let's call it "leagues". Is this table, the fields are simply the league name, and then about 15 other yes/no fields.
I then have a second table and related form. Lets call that "Games". The idea is that when the user selects any given league (which is a linked field to the first table), then I want only certain fields to show up based on the yes/no criteria.
I've found two other posts that offer some ideas, but I don't quite see my exact situation.
Hide Controls in MS Access Based on Value Field
and
Ms Access Hide and Show Fields based on combo box choice
In addition, All those other fields that may or may not be visible are all linked fields to a third table called "members". I want to ensure that when a certain member is selected in any given field, they cannot be selected in any other field for the current record. I can use validation rules on each control, but I feel there is an easier way.
Please, steer me in the right direction, and if you can offer sample code, that would help.

Related

Lookup tables in forms not displaying correctly in tables

So, I had lookup fields on my tables. I have recently learned that this is a bad idea. So, I'm trying to convert them to lookup fields in the forms that fill those tables.
The lookup list is drawn from another table with the individual values. On the table, I went into design view under the lookup tag and changed "combo box" to "text box." The fields that were previously lookup fields now display the "key" of the item that was displayed previously in the field.
The form still shows the correct lookup value but the associated table no longer does it instead shows the number associated with the value and not the value. What do I need to do to fix this.
I guess my question boils down to not knowing how to link a lookup field in a form to a text field in a table.
You don't need to change your forms, just update your tables - change lookup from combobox to text box, you did this correctly.
Existing forms should work as usual, with comboboxes, settings for those comboboxes were copied from table settings and not liked to table settings anymore.
In new forms you'll need to do the same manually: after placing the field to the form convert it to combobox then setup correct Row Source, Column Count and Column Widths properties of combobox.

How do I show only the available options in a combo box on an Access form?

I'm making a reservation system on Access 2010 and I have a form that reserves a table for a customer. I just input the customer's Customer ID, date and time of reservation, and the table.
Originally, my form's layout is like this:
However my professor said it wasn't efficient because you'd have to check the database just to see if the table is still available. He suggested a dropdown list of the available tables left for reservation. Also, the tables have a format of D-# or L-# depending whether it's for lunch or for dinner.
I know how to put the dropdown list and stuff but I'm not sure if I know how to update it.
My table (database) for the reservation is just the list of the reservations made on that day.
I hope someone can understand my idea.
Take a look at the Microsoft help article here:
Basing one combo box on another
In your case the values in the combo box (for the table numbers) would be based on the current value of a text box (for the date), but the principle is the same:
The Row Source for your combo box is a query that filters the list of tables based on their availability on the date specified by the .Value of the "Date" text box. In the After Update event for the "Date" text box you tell the combo box to .Requery so it will list the available tables on the date in question.

how to create a filter form for a Microsoft Access Report

I am fairly new to Access. I am trying to create a filter pre-report form. On this form, the user will be asked for a start and end date. He will also be given a list of Item names which are found in a different form/table and will have the ability to check off which items the report should filter on.
Do I need to use a subform for this? I tried one out, but I can't see how to add checkboxes, it seems to just give me a list and I can't modify the subform.
What I really think I need to do is to populate a checkbox list with all of the items in the other table. How exactly would I do this (if its really the best solution)?
You can use a regular form for this. You do not need to bind it to a table. Just drop 2 textboxes on the form, and as many checkboxes as you feel you need.
The report will be based on a query, which in turn will be based on this form. All the fields will be brought into the query and will reference the controls on the form.
For instance, let's say you have 2 textboxes on the form; one called txtStartDate and one called txtEndDate. The form will be called frmReportFilter. In the query that's driving the report, pull in your date column and in the Criteria put >=Forms!frmReportFilter!txtStartDate. This will pull in all records where your date field is greater than or equal to whatever is in the Start Date textbox. The rest will be referenced similarly.

How to filter a table field's listbox by the current record

How do I set up a table's field so that the listbox is filtered by that row's data?
I have a master table (TblMain) with 2 important fields: Client and Division. Currently, the Division field is set up as a simple Listbox that pulls from another table (TblDiv).
However, the Divisions are specific to each client with little overlap. My current basic setup doesn't make that distinction, so any division can be chosen for any client.
How do I set up Division so that the listbox is specific to that row?
I've tried doing an inner join within the row source (i.e. Select TblDiv.Div from TblMain Inner Join TblDiv on TblMain.Client=TblDiv.Client) but that doesn't seem to work, probably because I'm not referencing the Client value of the active row.
(I should add I'm not talking about Forms or Reports. Just the Table object)
Are you trying to add a look-up field to a table? This is almost never a good idea. Are you trying to filter a combobox on a continuous form? You cannot sensibly do this - any change will affect the appearance of every row, which is confusing to the user. There are work-arounds. For example, you can show a textbox for the Reference and a "Change reference" combo. This will avoid confusing users because the bound textbox will not update. You can set various properties of the change combo with conditional formatting to make it all prettier. Alternatively, you can use two subforms or a pop-up form to edit data.

Access: Multi-value field

I am trying to design a form where the user can search records to filter a report. The user must be able to select many values from a particular field (multivalued field). I understand I can use a list box, but the field has a total of 3,000 records and cycling through is too much. I just want to know what other ways I can let the user insert multiple values?
I have these ideas, but maybe you guys have another better way:
Creating multiple combo boxes and keep them hidden until the user hits an “add” button, but this limits me to the amount of values I can have. If I have 10 hidden combo boxes I can only enter a total of 11 (10 hidden plus the original visible) values.
Is it possible to have a temporary data grid where the user just enters the values.
Then comes the problem of getting this into the SQL Record Source. I am thinking of the SQL IN clause.
Any help or ideas, will be greatly appreciated.
I think that you should create Comboboxes where values from next combo are dynamically populated when value in previous Combo has been changed so that way you can create hierarchy of values to select.
I've done something similar for a few different applications in slightly different ways. Basically, I present the user with a table, allow them to right-click > filter (the same could be accomplished by providing a filter textbox for each corresponding field in the table you want to allow filtering on... in your case it sounds like you only need one). The filter box allows them to use 'and' and 'or' along with the actual text of what they're looking for. Then they click a button that opens the report and fills the report's filter field with whatever filter they had applied.
Of course, this assumes the user is familiar with the data they're filtering, and requires a bit of training, but for me it was a simpler alternative than displaying a list with a bajillion entries in it. Your mileage of course may vary :)