Reference: http://www.techonthenet.com/access/c...bind_index.php
the link above shows how to manipulate it manually, but what i thought is using vba code to execute it automatically when i click a button on a form.
Here is the code what i thought, but apparently it seems there are errors in it.
Code:
Private Sub lookup()
Set db = CurrentDb
Set fld = db.TableDefs("TABLE_NAME").Fields("TABLE_FIELD")
Set p = f.CreateProperty("DisplayControl", dbInteger, 111)
fld.RowSourceType = "Table/Query"
fld.RowSource ("TABLE_QUERY")
fld.BoundColumn (1)
fld.ColumnCount (2)
fld.ColumnHeads (False)
fld.ColumnWidths = "0;1 "
fld.ListRows (8)
fld.ListWidth (100)
fld.LimitToList (True)
tdf.Fields.Append p
tdf.Fields.Refresh
DoCmd.Close
End Sub
Thanks in advance.