I have a combobox with multiple columns. The first 2 columns are a category and subcategory of each item, and the 3rd column is the actual name of the item.
When I start typing for entry matching, it only ever matches with the first columns.
Is there a way to change which column's entries the combobox matches of what the user types?
Related
I am using Vue3 + Quasar for my website, here I implement a table by QTable component.
My table has 4 columns No., Name, Title, and Enrollment Date.
This is the initial state of the table, with all the records sorted by index (column No.):
The Enrollment Date column is sortable, and when I click sort this column, the column No. is mutated too:
I want to keep the column No. as a static column, it must stay the same when the table is sorted by another column.
Do you have any idea to do that?
I am new to databases, and I am working on a final project for a class. I have a database with tables related to each other as shown in the diagram here:
I want to create an unbound form that allows a user to add a new purchase to the purchase table by choosing their name, category, and store from data already in these tables, and then add purchase amount and date.
Since the purchases table does not contain the names of people, categories, and stores themselves, only the ID values from these tables' fields, I am struggling with how to create a form that will add the correct IDs into a new record in Purchases based on the names from other tables.
I am wondering if this requires VBA? I have tried playing around with the property sheet on forms, but I am struggling with which properties to address/what to do with them.
If anyone can explain at least a starting process to create this form.
Simply, use combo boxes that query Buyer, Category, and Store table data, hides the primary key ids, but shows the corresponding lookup value to the user. Users will select by the lookup value(s) but really are saving the id to Purchases table as new foreign key id.
As commented above, use a bounded form to map combo boxes to table id fields. Once you place a combo box, the default wizard will guide you on the steps but below are key property sheet attributes (which may be automatically set with wizard but can be manually adjusted later).
Data
Control Source: The column in table (i.e., PurchaseID, BuyerID, CatID, StoreID) to store the user-selected data of combo box (i.e., a form control).
Row source: A distinct SQL query of primary table id and all needed values for human searches. This can be a named table or saved query or an inline SELECT statement.
Row Source Type: If using SQL, Table/Query.
Bound Column: The position of primary table ID in the query resultset to be stored as foreign key Id. Usually this would be the first column.
Format
Column Count: The total number of columns from the recordsource including hidden, bound column.
Column Widths: To hide column from view, set its positional number within semicolon delimiters to zero. Preview form to decide how large to space out other columns. Do note: you can extend beyond the Width of combo box using List Width.
Column Heads: Optional and best if more than one column to guide users on the lookup value content (e.g., First Name, Last Name).
As example, for Category combo box on bounded Purchases table form, consider below property values:
Control Source: CatId
Row Source: SELECT CatId, CatName FROM Category
Row Source Type: Table/Query
Bound Column: 1
Column Count: 2
Column Width: 0";2.5"
Column Heads: No
I have a table of data in Excel. Column A contains Names, Column B contains their interest. Each interest has a separate row. I want to take the data from this table and have a single row with the name of the customer and a column for each of their interests. IE RAW Data:
I am looking to take the 4000 row table and grouping by the name. I am unsure how many times each name appears in the list (Once or Fifty times) but I want the interests placed on a single row with each interest in a separate column EG Desired Data:
I have tried the standard transpose....html table....and pivot tables but it will put the interests all in a row along the top regardless if the customer is interested or not and using a record count T/F that means the data sheet in harder to understand then if I leave it as one block and sort by name
Sure I am not alone with this but all searches for the past 2 hrs keep returning pivot/transpose or duplicate items. Any is appreciated
If you don't want to use VBA, you could first add a column, for instance in column C, with the title "InterestNum."
In C2, just put 1.
In C3, put =COUNTIF($A$2:$A2, $A3) + 1. This will find the number interest it is for the person.
Make a lookup column, for instance in column D. In D2, put =A2&C2
Then, make a list of all the people. I assume that you put this list starting in cell A2 of a new sheet. Then put headers starting in B1 so that B1 contains the title "1" and C1 contains the title "2" standing for the interest number and as many columns as you wish.
Then in Cell B2, put the formula =IF(ISNA(MATCH($A2&B$1,data!$D$2:$D$5,0)),"",INDEX(data!$B$2:$B$5,MATCH($A2&B$1,data!$D$2:$D$5,0)))
This assumes that your original data is in the data tab. I only tested with 4 rows, so you would need to change $D$2:$D$5 to have as many rows as you do. This works by looking up a combination of the name and interest number. It first checks to see if that combination exists in the data. If not, it leaves that interest blank. If so, it finds the actual interest by going to the same row of the lookup.
First remove duplicates using standard excel functionality to prevent having the same interest twice for a person.
Now, you could of course use VBA and perform exactly what you need.
However, I suggest that you use the pivot table.
If your data looks something like this...
... just use "Insert | Pivot table" and insert a pivot table to a new worksheet.
Then, configure the columns as follows:
Et voilĂ , there you have all your interests listed only once and if a person shares an interest, there is a "1".
If you would rather use VBA, just comment and I will edit my answer.
I'm trying to define the row source of a lookup field by selecting the table name from a separate lookup box.
The catalog of products comprises of about 41 Product Groups, which are then further divided into Types, some of which have over 100 types.
I have a table of Product Groups (41 groups), and I then have a separate table of Types for each Product Group (41 tables). All Type table names are exactly as they appear on the Product Group table. I want to be able to select the Product Group from a Lookup Box, and then select the Type from the corresponding table in a separate lookup box.
The images below should help give an idea of what I'm looking to do.
Set up of my first lookup box:
Set up of my second lookup:
Is this possible, and if so can anyone lend a hand ?
Thanks.
Just to summarize, you will need a single table with your TypeID, GroupID, and any other "Type" related fields.
Your Group ComboBox should have the ID field as its first column (makes the filtering much easier), So your control source should be:
SELECT [ProductGroup]![GroupID], [ProductGroup]![ProductGroup]
FROM [ProductGroup]
ORDER BY [ProductGroup];
Then in the properties for Group ComboBox on the Format tab make your column width 0";x" to hide the ID field.
The control source for the Type ComboBox should be:
SELECT [NewTypeTable]![TypeID], [NewTypeTable]![TypeName]
FROM [NewTypeTable]
WHERE [NewTypeTable]![GroupID] Like [Forms]![frmWithComboBoxName]![CboPGroup]
ORDER BY [NewTypeTable]![TypeName];
And again, if you want to hide the ID field, make the first column width 0".
You should also requery the second combobox in the afterUpdate() event of CboPGroup which will filter the second combobox based on the new selection in CboPGroup. The code (VBA) for that would be:
Forms!frmWithComboBoxName!CboType.Requery
I have the following table layout in an Excel data table (fed by a SQL query):
Name, Birthday, Children, Check In
The first three columns come from a database query, the Check In column should be a column where I can manually enter an x for example.
Now, when I refresh the data table, the entries in the last column should stay in the right row. Currently, when I refresh the table the entries stay in the very same row they were entered in (e.g. if you enter an x into row 4, refresh and row 4 becomes row 5, the x stays in row 4).
Is there a way to avoid this?
Thanks in advance!
Hopefully you have some ID that uniquely identifies each item in each row (you could use the Name column if you don't have duplicate names). Keep a copy of your old data that you have marked the "Check In" box for. Then do a basic VLOOKUP to see whether that name has check in.