Fill in table fields automatically from dropdown (1 Viewer)

sebseb538

New member
Local time
Today, 08:54
Joined
Oct 20, 2020
Messages
2
Hello,

I found quite easily how to fill in fields from a Combo box in a form, but I can't seem to do the same in a table. I would simply like fields in my table to be filled in automatically following a selection from a dropdown list of an external table with several columns (fields).

See attached image.
listeDeChoix.jpg



thanks

seb
 

Jon

Access World Site Owner
Staff member
Local time
Today, 12:54
Joined
Sep 28, 1999
Messages
7,303
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

Here are just a couple of tips for you:

1. Feel free to ask any question you like, however basic you may feel it is, or even if it has been answered before. Our expert members thrive on helping you out!

2. If you prefer a dark theme to the forums, just go to the bottom left of this forum and click "Default style". You will then see a selection of themes to choose from. I like Shades of Blue. :)

3. If you like the answer or answers you get, feel free to click the "Like" link on the bottom right hand corner of the post. If you hover over the Like link, you can even choose the type of smiley.

Above all, hang around here, have fun, learn stuff and join in.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:54
Joined
Oct 29, 2018
Messages
21,357
Hi. Welcome to AWF!

Storing redundant data in multiple tables is not really recommended.
 

Minty

AWF VIP
Local time
Today, 12:54
Joined
Jul 26, 2013
Messages
10,354
You shouldn't (and can't) do what you want directly in a table.
Tables are for storing data, not interacting with. Stick with your form.

As well as redundant data an Age field is meaningless as it is only correct at the time of data entry. Age should be calculated from the date of birth and never stored.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:54
Joined
Feb 19, 2002
Messages
42,970
Data entry should never be done directly into tables or queries even if it is for your own use. Using a form gives you the ability to add functionality and to ensure that the data entered is valid.

Here is a sample app that shows three ways to display data from your lookup table. Two of them include saving the data in a second table but you need to look long and hard into the need for this. In my experience, the only reason to copy data to a second table is because you want to capture a value at a point in time. The most common example is copying the Price in addition to the ProductID when you are creating an order. You want the price at the time the order is placed, not what it is tomorrow. There are other ways to do this with history tables, but the simplest solution in this case is copying the Price and copying data at a point in time does not violate normalization rules because when the price changes, you don't want your copy to change. You want it to remain what it was when you copied it.

I don't think age and telephone number fall into that category and you would probably not want to store age in any event. It would be more reasonable to store birth date and calculate age on the fly. My age today can be different from my age yesterday or tomorrow if I pass a birthday. If data can become invalid based on the passage of time, do not store it.
 

Attachments

  • FillFormFields20180816.zip
    342.4 KB · Views: 98

Users who are viewing this thread

Top Bottom