Autofill fields from other table

Hi!

I wonder how to autofill a few fields when I register a new “Timeregister”

So I have two tables.

Table 1
Costumers
|Timestamp|Costumer|Adress|Phonenumber|Type

Timestamp is Key and hidden

This table I fill in new costumers manually

Table 2
Timeregister
|TimeStamp|Date|Costumer|Adress|Workedtime|Type| and a few other columns

So when I create (Add) a new Timeregister this happens

Timestamp = Key (HIDDEN)
Date = fills automatic “Initial value = now()” (WORKS, no problem)
Costumer = List taken from Costumer table, dropdownlist (WORKS, no problem)
Adress = This I have a problem with, wants this field to autofill from “Costumers[Adress]” when I have choosed Costumer
WorkedTime = I fill in manually
Type = This I have a problem with, wants this field to autofill from “Costumers[Type]” when I have choosed Costumer
Other Columns I fill in manually

I hope you understand what I am after

Edit: I am pretty new to programming so please go easy on me

Thanks

0 4 116
  • UX
4 REPLIES 4

Hi, you can use dereference, from the table timeregister create new column, named [customersID] , then make it ref to table timeregister.
[Address] column expression will be : [customerID].[Address] the same with other…

I have tried to reference but I get confused and never get it to work.
The New column 'CostumerID", do I make it in Costumer table or timeregister table?
I assume it should be a unique idnumber, does it need to be key?

Hi sorry, my bad It should be “from the table timeregister create new column, named [customersID] , then make it ref to table customer”


from column [Address] of table TImeregister filled this expression: [customerID].[Address]

with type do the same [customerID].[Type]
Hope It clear, I was struggling with reference to ( maybe now still…) but the idea of reference is just like a look up function. in vlookup formula you need a value to search , ref column play that role , It’s is to identify the value you want to look up…

Top Labels in this Space