I currently have a Multi-Value field based on a list of e-mail address, in MS Access 2016. Both the destination table, and the table where the list is pulled, are linked tables. The ComboBox doesn't work for either Queries or Forms when the destination table is a Linked Table. It works for regular Table.
I wish to save multiple e-mail address in this field, without having to use a secondary table (this would be a better design, but would make building forms a complete nightmare, both for me and the users). The inner data storage is a CSV-like format with a ";" delimiter, automatically handled my Access.
To answer obvious questions :
I will not use a separate table as "Good Design" suggests, to not kill UX and database simplicity.
There is no VBA involved at all anywhere in that selection form.
Question : What am I missing, and what can I do to make this work in an MS Access Form with a linked table?
Here it what the selection tool from Access Form looks like :
The solution ended up being :
Unlink the table from the front-end
Re-link it
It seems like any complex field (Multi-Value, Calculated, Attachment) requires a re-linking of the table.
Related
I am trying to add three fields which are automatically calculated from a form to an existing Table with three more columns in Microsoft Access?
There are two types of forms in the world of MS Access: unbound forms and bound forms. Here is an example of an unbound form.
Unbound Forms
Let us look into Unbound Forms −
These forms are not connected to an underlying record or data source.
Unbound forms could be dialog boxes, switch boards, or navigation forms.
In other words, unbound forms are typically used to navigate or interact with the database at large, as opposed to the data itself.
Bound Forms
Let us now understand what Bound Forms are −
Bound forms are connected to some underlying data source such as a table, query, or SQL statement.
Bound forms are what people typically think of when they think of the purpose of a form.
Forms are to be filled out or used to enter or edit data in a database.
Examples of bound forms will typically be what users use to enter, view or edit data in a database.
Now, let's look at an example of a unbound form.
Basically it is a form that is not bound to any database table or query. You can usually determine if a form (or a control on a form) is bound by looking at its record source property which will either be bound to a Table, Query or SQL String. Also if you look at each control on the form you will find that each control has a Control Source, which is derived from the field names made available in the Record Source. A bound form is easier to create and requires minimal programming (if any). It allows for rapid application development since Microsoft Access is designed to make application development fast and easy. An unbound form on the other hand requires a lot of programming, BUT gives you near total control over how your application is going to work. This in some cases outweighs the numerous benefits offered by bound forms.
The Database
The contacts database has one table called contact with the following fields:
Field Name Data Type
cid (Primary Key) AutoNumber
name Text
address Text
email Text
occupation Text
age Text
Copy and paste or import the following sample data into the contact table:
1,"Axaro Dausab","255 Amite Street","ax#dausab.com","Market analyst","20"
2,"Khagu Noabes","58 Xamiseb Road","khagu#noabes.com","Medical Student","22"
3,"Dantago Nuseb","2 Nuseb Street","dan#nuseb.com","Medical Student","22"
4,"Phuna Noabeb","2 Nuseb Street","phuna#noabeb.com","Web Designer","30"
5,"Aribasen Seibeb","58 Xamiseb Road","areez#seibeb.com","Researcher","35"
6,"Zion Maletzky","58 Xamiseb Road","zion#maletzky.com","Web Designer","20"
7,"Leidago Noabeb","277 Mudi Road","leidago#noabeb.com","Web Designer","30"
8,"Amite Itheke","26 Shanke Road","am#itheke.com","Market Analyst","40"
9,"Amire Ganuseb","23 Ganuseb Road","amire#ganuseb.com","Fashion Designer","45"
10,"Dinashange Develo","40 Develo Road","dina#shange.com","Journalist","23"
If you want to use your own data it is fine, but for the sake of facilitating things I would recommend using the sample data.
So the structure of your contact table should now resemble something like this:
The Contact table in design view
And with sample data it should look something like this:
You can download a working example from the link below.
http://www.databasedev.co.uk/unbound-forms.html
Now, let's look at an example of a bound form.
To create a form with a single click,1.Open the table or query upon which you want to base the form.2.To create a form on which all fields from the underlying table or query are placed, displaying one record at a time, on the Createtab, click Form.
See this for more details.
https://www.tutorialspoint.com/ms_access/ms_access_create_form.htm
Not exactly sure how to title this one..
I have 2 tables (websites & website_info).
The websites table has a column called websites_website_info_id, which has a relationship linked to the website_info_id row in the website_info table.
I created a form from the websites table, and I want to be able to choose a row from the website_info table (in a subform). For example, the website_info table has a list of hosting providers used, I need to link these hosting providers with the websites. Only problem is, I cant find a way to choose a singe row from the website_info table and insert the id number into the websites_website_info_id column of the websites table.
I can create a lookup to find the ID, but i have to copy and paste it, which is not ideal because there will be others using this app. If it was just me, then i would be ok with that, but I need it to be as easy to use as possible for anyone to use without having to give too much instruction.
So, is there a way to find a value in a subform and add a value from the subform to a column in the main form.
Normally I would just use a lookup on the column in the table itself, but the database is a myslq database hosting on an external server so using lookups isn't an option.
Yes.
This will - in the main form - return the current ID of the subform:
Dim SubId As Long
SubId = Me!NameOfYourSubformControl.Form!ID.Value
I want to be able to track any changes made to any of the fields in an existing table. The scenario is as follows:
the user opens the datasheet view for an existing table in MS Access 2007/2010
updates values in 2 fields and 5 rows (10 cells)
saves the table (overwrites it)
I want to be able to push the changes (10 changes/rows) to a new table and then be able to open it in datasheet view to refer to it. Is there a way I can do this in access without using form?
In 2010 and later you can use data macros, or what often other systems called table triggers.
You cannot in 2007.
Keep in mind that your use of the term “save table” is VERY wrong in the context here. In fact VERY wrong in the context of most databases. The user does not “save” the table.
You can ONLY edit ONE ROW at a time in a datasheet. When you move off that record then the ROW is saved (not the table). , and if you move off, then the record is saved.
In 2010 and later, you have use of table procedure code. This thus will allow one to use a table trigger.
So 2010 and later does support table triggers and store procedure code. But since your question in includes Access 2007, then my suggestion to use table triggers (called data macros) may not work unless you can restrict users to 2010 and beyond.
In the follow example, when a user updates a row, then a “audit” table is updated with the user information. The function fosusername() is in fact a VBA function. This code is called from the before change update event for the table.
Of course the problem here is the VERY basis of your question assumes that users save a table – they don’t, they edit + save “single” records, or a single row at a time. So figuring “out” how a user is done would certainly be a challenge. So while code can be run when the users edit data, having table code run “when” the user closes the table is not possible.
As the end of the day, it likely best you create a datasheet that looks just like the table, and then change a few settings to “lock down” and prevent the user from using tables directly.
As far as I know there is no solution for this without using a form. I do not know of events (like a change or dirty event) for the actual data tables.
In a form you could use the dirty property to make sure you fetch the data. You can make the form look like a datahseet with DoCmd.RunCommand acCmdDatasheetView or set the form in datasheet view on default.
This is the simplified version of the problem: We have a table on an Oracle Database. We cannot extend this table (bought app). We need to describe each row of that Oracle table with some text.
So the descission has been to use MS Access for this. So I created in Access a table (Call it ACCESS_TABLE). The table consists of ID and MEMOTEXT (and more). The ID is the link to the table on Oracle (Call it ORACLE_TABLE). I have successfully linked up MS Access thru ODBC to Oracle and have both tables available.
My first idea was to JOIN them. But then I cannot do edit. MS Access locks all fields up because of the JOIN with an ODBC table.
Then I thought of creating a form to just edit the ACCESS_TABLE and display the data from the ORACLE_TABLE. This might work but I abandoned that idea also because I want to show the user the ORACLE_TABLE (as the leading table) so that the user knows what rows still need a description.
So I was wondering whether I copy all data from the ORACLE_TABLE and add it to the ACCESS_TABLE. I then have to implement some replication algorithm of deleting/updating rows in the ACCESS_TABLE when they change but this might work. And I wondered how this could be done best.
Also I wondered whether I am at all on the right track or should tackle the problem differently in general.
Why did you abandon the form so quickly? Did you try Oracle as the main form and Access as a subform? It is also possible to have two subforms synchronized, so that subform 1 shows all Oracle records, joined to Access, if required to show whether an Access record exists, and subform 2 shows the Access record for the selected record in subform 1. There is an example in the Northwind sample database (customer ordser form, AFAIR).
I am new to Access and i am in the process of creating a database for some of our users. I have designed a form where the user name, first and last name etc are inputted.
Some of these users work for more than one department which means I need some type of listbox control that allows them to select more than one department when they enter their contact info.
In VB Studios 2005, this control is called a CHECKED LISTBOX. I have looked everywhere in access but cant seem to find it or anything closely similar.
The option of a listbox or combobox is not feasible here as these only allow the user to select one option only when inputting their details. Any help with this is much appreciated.
Use an ordinary list box with the "Multi Select" property set to "Simple".
The user can then click multiple list items, all of which stay selected until they un-select them again.
You may wish to consider a subform, as this will save you the trouble of updating a table with the data from a list box. A subform can use a department-person junction table with person id as the linked child field and master field. A combobox bound to department id will allow the user to select departments.
If you are really set on having checkboxes, Stephen Lebans has a sample database that uses the built-in Access listbox with checkboxes (from one of the Access wizards).
There is another choice:
If you are using Access 2007, you can declare your field as a lookup field accepting multiple values.
When you bind the list box to that field, you will get checkboxes.
It's easy to use them.
You'll also find more information is available from the MS Office website.
However, note:
This is only possible in the new Access 2007 database format and you will not be able to save your database to the older MDB format.
Multiple value fields are not compatible with most other databases, meaning that if you decide one day to upsize to SQL Server, you'll have to redesign your tables to use a junction table as Remou mentioned.
These multi-value fields are difficult to use from VBA: the value they return is in fact another recordset that you must iterate through to get all the values.
Having said that, if you just want something simple and you're not planning on manipulating the database from code, then it can be a practical option, albeit not a very compatible or future-proof one.
I'm not using them, but I think others should be able make their own decision knowing what is available to them.