J
Jen
See responses below...
Regards,
Jen
to plug into your project. what you need to do to get it
to work is change the tblName to whatever table is
relevent for you, change the HIDDEN FIELD to the primary
key for that table and change the [NameofField That is
Relevent for me] to whatever field it is that has the
values you want your combobox to populate with.
Same problem as above. Change the names of everything.
On last line where it says =[Forms]![frmName]!
[Combo2].Value, leave the [Forms]! there - Access syntax.
Regards,
Jen
Looks like someone was kind enough to give you this code-----Original Message-----
1) I've created a combobox that takes data from a table.
And I used the Distinct function to filter out the
repeated values in the table. However,when I click on my
combobox and select a value, let's say 4000, the number
that shows after I click on the value is 20; 20 is the
very first number that appears in line in the combobox.
How do I correct this?
SELECT DISTINCT [tblName].[HIDDEN FIELD], [tblName].
[NameofFieldThat is Relevant for me] FROM [tblName];
to plug into your project. what you need to do to get it
to work is change the tblName to whatever table is
relevent for you, change the HIDDEN FIELD to the primary
key for that table and change the [NameofField That is
Relevent for me] to whatever field it is that has the
values you want your combobox to populate with.
2) In addition, I created combobox2 that takes data from a
table (its values are unique). And I wrote a code so that
the values shown will only be those related to values in
combobox1. That way, instead of a list of 80 text shown
in combobox2, it should be just about 5 or so. However, m
y code does not work. Now values appear in my combobox.
Here is the code:
SELECT [tblName].[HiddenFieldForSomeReasonIs Listed],
[tblName].[RelevantField2] FROM [tblName] WHERE
[RelevantFieldFromCombobox1]=[Forms]![frmName]!
[Combo2].Value;
Same problem as above. Change the names of everything.
On last line where it says =[Forms]![frmName]!
[Combo2].Value, leave the [Forms]! there - Access syntax.