Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

In Access how do I define a value looking up a value in a table?

1 réponse
Avatar
RickJ
When updating one field I want another field to be automatically updated by
looking up a value in a table. I would like to be able to use the normal set
macros if possible as I am not a programmer

1 réponse

Avatar
Eric
Hi,

See the DLookUp() function.

In a form:
Text0 is a filled TextBox
Text2 is a textbox to fill
Text2 ControlSource:
=DLookUp("TheField","TheTable","Id=" & Text0) if Id is Numeric or
=DLookUp("TheField","TheTable","Id='" & Text0 & "'") is not

or
Create a macro whith Action DefineValue
Item: ControlToDefine (ex: Text2)
Expression: DLookUp("TheField","TheTable","Id=" & Forms!Form1!Text0)

with Text0 updated TextBox in the form named Form1
Text2 receive the value of the TheField from the table TheTable

When updating one field I want another field to be automatically updated by
looking up a value in a table. I would like to be able to use the normal set
macros if possible as I am not a programmer


--
A+
Eric
http://users.skynet.be/mpfa/
Archives : http://groups.google.fr/group/microsoft.public.fr.access?hl=fr