A family of Microsoft relational database management systems designed for ease of use.
So is there a way to an excel like vlookup in a table?
Take a look at the DLookup function in Help.
But mostly you won't use it, you'd join the tables in a query. So if we take Scott's example of a Colors table, and assume we have a Vehicles which includes a foreign key ColorID column, then we might have a query along these lines:
SELECT Vehicles.Model, Colors.Color
FROm Vehicles INNER JOIN Colors
ON Vehicles.ColorID = Colors.ColorID;
This would show the model and colour of each vehicle
In a form for entering data you'd base the form on the Vehicles table and include a combo box set up as follows:
ControlSource: ColorID
RowSource: SELECT ColorID, Color FROM Colors ORDER BY Color;
BoundColumn: 1
ColumnCount: 2
ColumnWidths: 0cm
If your units of measurement are imperial rather than metric Access will automatically convert the last one. The important thing is that the dimension is zero to hide the first column.
To enable you to enter a new colour not currently represented in the Colors table you'd put the following code in the combo box's NotInList event procedure, which would insert a new row into Colors, subject to user confirmation, when you type the new colour into the combo box:
Dim ctrl As Control
Dim strSQL As String, strMessage As String
Set ctrl = Me.ActiveControl
strMessage = "Add " & NewData & " to list?"
strSQL = "INSERT INTO Colors(Color) VALUES(""" & _
NewData & """)"
If MsgBox(strMessage, vbYesNo + vbQuestion) = vbYes Then
CurrentDB.Execute strSQL, dbFailOnError
Response = acDataErrAdded
Else
Response = acDataErrContinue
ctrl.Undo
End If