make field a dropdown in access 2007 - database

I'm creating a HR database in access 2007
I have a main table of employee info and several tables that relate to that table ( education for example) that list the acceptable elements that can populate that cell in that row
When i create a form it was created as just a plain text field which is constrained but I wanted to create a dropdown that had just the data that they are allowed to enter to avoid confusion.

You should be able to right-click the text box and select Change To -> Combo Box.

If you are not familiar with creating controls, it is best to use the wizards. Select a combobox from the toolbox and add it to your form, you will be guided through creating the type of combo that you want.
You should also examine the relationships you have created.

Related

MSAccess populate multiple fields with a single pulldown

Challenge: I've created a simple repository in MSACCESS (#1) that displays one or more owners of a corporate server.
The sub-form "asset-owners" is linked to the corp-assets main-form (#2). I've added a pulldown whereby the user can select a name (#3) from the address_book (#4) table and prepopulate the owners sub-form.
Objective: I would like to auto populate the associated "Occupation", "Favorite Food", and "Favorite Movie" fields when the user selects a name from the pulldown (#5).
I am not exactly sure how I should configure the occupation food and movie fields to auto-populate with such data AFTER the user has selected the name. I was thinking an inline query for each field, but I suspect it may be simpler than that.
Note: occupation, food, and movie data comes from the address_book (#4).
Many thanks!
I hope you don't want to repeat data in another table. If you just want to display the related data, options:
create multi-column combobox then expression in textbox references combobox column by index - index begins with 0 =[comboboxname].Column(1)
include lookup table in form RecordSource and bind textboxes to fields - set them Locked Yes and TabStop No
DLookup() expression in textbox.

How do I get access database to form a relationship from one to many?

In my database I have formed the relationship from one to many on the right of the screen shot, but for some odd reason it will not let me do it on the left of the screenshot. I want to connect both cust_IDs (or customer IDs) and make it a one to many relationship. I would really appreciate any help this because it will allow me to practise forming one to many relationships on Microsoft Access.
Here is my screen shot of the problem
This is easy in Access and will not require any code.
Create a main form based on tblCustomers.
Save this form.
Now create a multiple items form based on tableRentals.
Delete the column for vid_no, and then use the combo box wizard to create a combo box – this will allow you to select from tblVideo, and return/set the vid_no column.
Ok save this form.
Now re-open the main tblCust form in design mode, and drag + drop in the multiple items form you created above.
You should now have a working form.

Filemaker dropdown not working

I've created a dropdown box in layout mode of filemaker and specified a field to pull in. However the box is remaining blank and not pulling in any of the information from the field in the table. What can have been missed for this to happen?
Most probably it is the problem with the value list set up or the relationship you are using to pull in the data for your drop-down.
If you are using a value list from a related data, place a portal based on the same relationship on the same layout and see if data comes through. If it does not - resolve your relationship first.
If you are pulling all values from a field in the same table, make sure in the value list setup you select the same relationship as the one the layout based on, the target field is selected and "Include all values" option is checked

Set combo box value using VBA

I am attempting to set the value of a combo box from a "Splash Screen" type form in Access that will take the user's computer name and load two combo boxes on another form with the Employee ID and Manager ID, which are both bound columns of the combo boxes, which are unbound themselves. I can get the IDs in the combo box, but i want it to still display column 2 (Names) of both combo boxes. Right now it just displays the IDs. Anyone got any ideas how i can get it to react like i actually picked it in the combo box?
So, comboboxes can sometimes be tricky, but once you get it down you should be good to go.
So, when looking at a Combobox's properties,
The Format tab :
ColumnCount: 2 <-- You want the ID and the Name
ColumnWidths: 0";1" <--- You're hiding the ID field, which is the first column
The data tab:
This is where you're going to tell Access what data you're supplying for your combobox.
Usually it's a query or table data source. If it's a query you should be selecting the ID and Name fields, and use that query in the RowSource property in the Data tab.
Row Source: Select ID, Name FROM YourTable
Row Source Type: Table/Query
When you use the Wizard to create the combobox, it's fairly straightforward. When Access asks you to format your data source, you completely shrink the ID column, so it hides it (but it's still there).
The steps would be:
I want the combobox to look up the values in a table or query
Select the Table or Query
Select the Fields (ID and Name seem appropriate for your scenario)
Any sorting you may want
The next screen is where we want to hide our ID column, so shrink it entirely
The next screen is where we tell Access that we want the ID to be in scope (selected) when we select a combobox item
Name it & be proud

Adding an order for a customer selected from a list view in Access

I followed this great guide to help me add a search feature to my Access database:
http://www.techrepublic.com/blog/howdoi/how-do-i-populate-an-access-list-control-with-the-results-of-a-dynamic-search/108
At the end it says:
"If you’re building a quote or order, use the list control’s Click or Double Click event to copy record(s) to a temporary table. It’s easy to implement using a fixed query for each search task."
I have managed to display all search results in a list box and I would like to be able to click on a customer to highlight them, and then press a button to add an order to the selected customer. I've been thinking how I could do it and I really can't get my head around it.
Any help would be appreciated.
It depends on how you build your database. My guess is that one easy way would be:
Create a table with customers;
Create an "Order" table with orders where you link the customers through a foreign key
You load the customers in a listbox. While making the name visible, it is actually the ID that you retrieve when clicking the listbox. You can configure this via the wizard in the design view of a table. You can make other forms appear by events on the listbox (eg. on click).
If you managed to retrieve the ID of the customer, and you have the data related to the order (data that can easily be extracted from form objects and loaded into variables ) what you need is an insert statement and insert the values in the "Order" tabel (including the customer ID, which is linked through the foreign key).
This way all order records are linked to the customer and can be queried later.
Due to my limited knowledge on your other requests, I cannot help you any further on the rest of your database design.
I hope that my reply could help you and that I understood your question correctly.
You can access info from a listbox via:
List.Value
Or if it is not the first column then:
List.Column(0,0)
0 being the column and row references.
You may also consider using a listview over a listbox and then you can access the relevant parts of a listview control with the following code:
ListView.SelectedItem
Or if it is not the first column then:
ListView.SelectedItem.SubItems(3)
3 being the column reference

Resources