On Thu, 23 Mar 2006 16:40:40 -0500, mshenoud
<ms******@mailbox.syr.edu> wrote:
I have a comboBox with two columns. I would like to isolate each
column soas
to compare it to an entry in a table so as to be able to load a yet
anotherform. how can I do that?
Details: The form is called MasterForm, it has a two columned
comboBoxcalled
InsPVComboList. "Text.[column](0,0)" is my attempt to add to the
wherecondition in the macro to isolate each entry in the combobox. I have
triedInselection.[column](0,0) but it did not work.
The code is as follows:
Forms![MasterForm]![InsPVComboList].Text.[Column](0,0)=[RejectionsTable]![Pa
rt
s_#]) And
([Forms]![MasterForm]![RejPVComboList].Text.[Column](0,1)=[RejectionsTable]![
Vendor_Name])
Thanks
Mike
Columns in Access combos are zero-based; the first column is 0, second
is 1 etc etc. You refer to Columns in a combo as such:
Me.Combo1.Columns(0) << this is the first column
Me.Combo1.Columns(1) << this is the second column
This refers to the currently selected value of the combo; you can also
refer to the "list" of the combo by doing this:
Me.Combo1.Columns(0,1)
The first number is the "column", second is the "row", so the example
above would refer to the First column, Second row (since rows are also
zero-based).
Your code would look something like this:
Forms![MasterForm]![InsPVComboList].Column(0,0)=RejectionsTable![Parts_#]
And
[Forms]![MasterForm]![RejPVComboList].Column(0,1)=[RejectionsTable].[Vendor_Name]
This would be the First COLUMN Of row #1 and row #2 ... if you want to
get Column 1 and Column 2 of Row #1 you'd do this:
Forms![MasterForm]![InsPVComboList].Column(0,0)=RejectionsTable![Parts_#]
And
[Forms]![MasterForm]![RejPVComboList].Column(1,0)=[RejectionsTable].[Vendor_Name]
watch for word wrapping on this one ...