Discussion Locked

Access 2000 --- drop down boxes

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a table with two columns (Reference,Name)
On a form I would like to have a drop down box to pick the Reference and another to show the Name based on this Reference(It(Name) does not need to be a drop down.

I would also like to be able to add items to a drop down list if they do not exist, my attempts at this do not seem to produce the required result even after consulting the help section.
I think I might need the NotInList statement in VB but am unsure how to wright the code.

CAN ANYONE HELP PLEASE ?????

3 replies

by john_wills

This is for a pair of drop-down boxes where the possible values of the second depend on the chosen value of the first.
RowSource for first:
SELECT CodesForMajorEthnicity.ID, CodesForMajorEthnicity.Name
FROM CodesForMajorEthnicity;

Private Sub MajorEthnicity1_Change()
Me.MinorEthnicity1 = Null
Set CtlList = Me.MinorEthnicity1
CtlList.Requery
End Sub

Rowsource for second:
SELECT CodesForMinorEthnicity.ID, CodesForMinorEthnicity.Name
FROM CodesForMinorEthnicity
WHERE (((CodesForMinorEthnicity.MajorEthnicityID)=[Forms]![Client].[Form]![MajorEthnicity1]));

This discussion is closed to new replies.