Pretty sure my issue is due to multivalued combo box fields-
I don't get duplicates in my query, but I do get duplicates in the report based on that query. It appears the duplicates are for records that have more than one value selected in one or more multivalued fields.
I've checked and the query is not using .Value fields. As far as I can tell the query is fine- it's the report that's creating duplicates.
Table design:
Table design
Multivalued fields are lookup fields that lookup values from a table:
Resource Categories
Provider type
Type/Format of Resource or Service
Target users
Accessibility
These fields are lookups with single choice combo box:
Local or National
Related
I have a query based on two tables. The query is the RecordSource for several forms.
I can easily display fields from the query (such as CompanyID) in text boxes on a form, but I'd also like to display some of those that I left behind on the tables (such as CompanyName).
The simple answer would be to add all those fields from the tables to the query, but many of those fields are used only on one of the forms. I'd hate to clutter the query with lots of such fields if I can just pull "CompanyName" from the underlying table.
I hope there's another way to do it (linking the tables or something. I've seen an SQL query used as a RecordSource, but I don't know if that applies to me).
Normally a form is used for data entry/edit to only 1 table. Including other tables (such as lookup tables) in form RecordSource is usually not necessary and often just adds confusion.
Use a multi-column combobox to view associated data. For example, a combobox to select company can be designed to display CompanyName but save CompanyID into an Orders record.
RowSource: SELECT CompanyID, CompanyName, CompanyAddress FROM Companies ORDER BY CompanyName;
ColumnCount: 3
ColumnWidths: 0;1;0
BoundColumn: 1
ControlSource: field to save CompanyID into
Then the combobox will display company name.
Can also have a textbox display company address with expression that references combobox: =[cbxCompany].Column(2)
An alternative is DLookup() domain aggregate function expression in textbox but domain aggregate functions can cause slow performance in queries and on forms.
Yes, SQL statements can be used in RecordSource instead of referencing table or query object. Either way, if lookup tables are included, textboxes bound to those fields should be set as Locked Yes and TabStop No to prevent edit of those fields.
I've coded my entire database to rely on recordsets and updating those recordsets on click of record IDs within other forms. Then I discovered that I can't edit the records from the datasheet. So I need an alternative.
My database consists of the following tables: Customer, Address, Order, Details, Contact and Misc. Each of these tables has a PK which is stored in a table called Master_Bridge which constructs a unique combination of all the PKs.
I have a form which includes each of these tables as a subform. The user begins at the Customer subform. When they click the Customer_ID, the Address table needs to filter based on where that Customer_ID exists within the Master_Bridge.
I was hoping to store each of the IDs into a recordset, or an array of some type, and translate each of those values into the filter. Admittedly, my VBA isn't good enough that I know how to do that.
I also tried a nested select in the recordsource of the Customer form, where I selected all of the Address_IDs. Again, couldn't edit.
Do you folks have any suggestions on how to proceed with this? I'll also need the click of Address_ID to filter the Order form by using both the Customer_ID and the Address_ID. The rest of the tables/forms will utilize the above 3 IDs.
Just stuck on getting information from two sources, we have a MYSQL database for repairs information which I have in SSRS, this brings back 7000 rows. We have another Repairs database in Oracle which brings back over 3 million rows.
I can't seem to bring the one from oracle as it exceeds the maximum limit, but is there any way do a left join using so i can bring only the two columns i need from the oracle one into the MySQl one which would mean i have 7000 rows plus the 2 columns from Oracle which have a common Primary key. I can't seem to join on two dataset with it being on two database.
Can anyone help.
THank you in advance
You can use the Lookup function in SSRS to find a value from one dataset based on a common key.
=Lookup(Fields!SaleProdId.Value, Fields!ProductID.Value, Fields!Name.Value, "Product")
Use Lookup to retrieve the value from the specified dataset for a
name-value pair where there is a 1-to-1 relationship. For example, for
an ID field in a table, you can use Lookup to retrieve the
corresponding Name field from a dataset that is not bound to the data
region.
(BIDs Description)
In the above example, the SalesProdID from one dataset is being used to relate to the ProductID in the Product table to get the Name field.
This will only return one value, though. This may or may not be OK depending on your data. If you need to return multiple values, use LookupSet.
=LookupSet(Fields!TerritoryGroupID.Value, Fields!TerritoryID.Value, Fields!StoreName.value, "Stores")
Use LookupSet to retrieve a set of values from the specified dataset
for a name-value pair where there is a 1-to-many relationship. For
example, for a customer identifier in a table, you can use LookupSet
to retrieve all the associated phone numbers for that customer from a
dataset that is not bound to the data region.
Unfortunately, you might need to SUM a Lookup but that isn't supported by a function in SSRS. Fortunately, users created a function for it:
SSRS Count Occurances based on multiple columns
I have three tables: Article, Order, OrderDetail.
In the Orderdetail Subform of the Order Form I have a Listbox named 'ChoseArticle' that is linked to the table 'Article' (not to a Query).
Now if the user choses one of the articles in the Listbox, it can undoubtedly be stated that the article record just chosen is well defined. How do I access the fields of the chosen article record WITHOUT using DLookup?
Article![Art-No] gives a type mismatch error.
ChoseArticle.[Art-No] gives an error Method or Object not found
Me.ChoseArticle gives me the first Listbox column of the chosen article.
But how to access the other fields of the chosen article?
Note that my Article table intentionally has no primary key.
Finally I have found the solution myself:
First of all, in the subform's Listbox, set the number of columns of the list fields equal to the number of fields (n) in the 'Article' table.
Second, choose the column widths, e.g. 2cm;2cm;2cm;0cm;0cm;0cm ..., again for as many fields as there are in the table (n).
Third, access the fields of the chosen record with Me.ChoseArticle.Column(x), where x is between 0 and n-1, and ChoseArticle is the name of the Listbox.
Dlookup() is therefore not necessary, which comes in handy when accessing records of tables with no primary key.
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.