combo box auto fill problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
Here is the situation. I need to fill in two fields in a form after a combo
box choice is selected. I pulled in the 3 fields in the query that the combo
box is based on. The Combo box list, the Next field, and the one after that.

Next, I wrote the code that was given to me by stating that "The next field"
= Information.Column(1). and it works

"The one after that" = Information.Column(2) and it does not work

if I change it to column(1) for "The one after that" it works. so for some
reason I can't pull up Column(2) data from the combo box.

Please help if you can

thank you in advance

titan
 
Here it is

SELECT Violations.Sections, Violations.[Brief Description], Violations.[Name
of Violation] FROM Violations;

thanks for the help

titan
 
Titan,

The first thing I would check is that [Sections], [Brief Description], and
[Name of Violation] are all valid field names in Violations and that you've
spelled them as they're defined.

I would also check to see if the particular record you tested the combo box
on has a non-null Name of Violation field. It could be your code is
assigning the value properly but that it has no value.

Secondly, ensure that the combo box' Column Count property is set to 3,
otherwise, the last column won't be included even though it's in your
RowSource field list.

Lastly, you do not need code to display other columns of a combo box.
Simply set the textbox' ControlSource property to:

=YourComboBox.Column(index)

Hope that helps.

Sprinks

titan said:
Here it is

SELECT Violations.Sections, Violations.[Brief Description], Violations.[Name
of Violation] FROM Violations;

thanks for the help

titan

Sprinks said:
Titan,

Please post the Row Source of your combo box.

Sprinks
 
Thanks for the help.
I tested what you said. The column count was 1, so i changed it to 3, but
then all 3 field names came up. I was actually trying to get it so that when
the combo box option is selected, the corrosponding fileld names would go to
their respective places on the form. It works for the first one.(brief
description) (comumn 1) but not for Name of violation( column 2), if i call
both column (1) then it works in both fields but with the wrong information
in the second field (is the same information becuase they are both column 1
information. So somehow column 1 option works on both fields, but not column
2. how it is now , it just wipes out what was in there and places nothing in
its place. Im thinking now, that since its doing that, perhaps its placing a
NULL value in there, but Im not sure how to check and fix it.

if you could help i would appreciate it.

thanks in advance

titan


Sprinks said:
Titan,

The first thing I would check is that [Sections], [Brief Description], and
[Name of Violation] are all valid field names in Violations and that you've
spelled them as they're defined.

I would also check to see if the particular record you tested the combo box
on has a non-null Name of Violation field. It could be your code is
assigning the value properly but that it has no value.

Secondly, ensure that the combo box' Column Count property is set to 3,
otherwise, the last column won't be included even though it's in your
RowSource field list.

Lastly, you do not need code to display other columns of a combo box.
Simply set the textbox' ControlSource property to:

=YourComboBox.Column(index)

Hope that helps.

Sprinks

titan said:
Here it is

SELECT Violations.Sections, Violations.[Brief Description], Violations.[Name
of Violation] FROM Violations;

thanks for the help

titan

Sprinks said:
Titan,

Please post the Row Source of your combo box.

Sprinks

:

Hello,
Here is the situation. I need to fill in two fields in a form after a combo
box choice is selected. I pulled in the 3 fields in the query that the combo
box is based on. The Combo box list, the Next field, and the one after that.

Next, I wrote the code that was given to me by stating that "The next field"
= Information.Column(1). and it works

"The one after that" = Information.Column(2) and it does not work

if I change it to column(1) for "The one after that" it works. so for some
reason I can't pull up Column(2) data from the combo box.

Please help if you can

thank you in advance

titan
 
Titan,

You *must* set the column count to 3 to have access to all three column
values. You needn't display them all, however--simply set the ColumnWidth
to 0" for the undesired ones.

As far as checking the value of Name of Violation, temporarily set the
ColumnWidths so that you can see the value of each field. If there is a
non-null value in Name of Violation, and on selection, it is not pushed into
the textbox defined by

Information.Column(2)

then I'm stumped.

Hope that helps.
Sprinks

titan said:
Thanks for the help.
I tested what you said. The column count was 1, so i changed it to 3, but
then all 3 field names came up. I was actually trying to get it so that when
the combo box option is selected, the corrosponding fileld names would go to
their respective places on the form. It works for the first one.(brief
description) (comumn 1) but not for Name of violation( column 2), if i call
both column (1) then it works in both fields but with the wrong information
in the second field (is the same information becuase they are both column 1
information. So somehow column 1 option works on both fields, but not column
2. how it is now , it just wipes out what was in there and places nothing in
its place. Im thinking now, that since its doing that, perhaps its placing a
NULL value in there, but Im not sure how to check and fix it.

if you could help i would appreciate it.

thanks in advance

titan


Sprinks said:
Titan,

The first thing I would check is that [Sections], [Brief Description], and
[Name of Violation] are all valid field names in Violations and that you've
spelled them as they're defined.

I would also check to see if the particular record you tested the combo box
on has a non-null Name of Violation field. It could be your code is
assigning the value properly but that it has no value.

Secondly, ensure that the combo box' Column Count property is set to 3,
otherwise, the last column won't be included even though it's in your
RowSource field list.

Lastly, you do not need code to display other columns of a combo box.
Simply set the textbox' ControlSource property to:

=YourComboBox.Column(index)

Hope that helps.

Sprinks

titan said:
Here it is

SELECT Violations.Sections, Violations.[Brief Description], Violations.[Name
of Violation] FROM Violations;

thanks for the help

titan

:

Titan,

Please post the Row Source of your combo box.

Sprinks

:

Hello,
Here is the situation. I need to fill in two fields in a form after a combo
box choice is selected. I pulled in the 3 fields in the query that the combo
box is based on. The Combo box list, the Next field, and the one after that.

Next, I wrote the code that was given to me by stating that "The next field"
= Information.Column(1). and it works

"The one after that" = Information.Column(2) and it does not work

if I change it to column(1) for "The one after that" it works. so for some
reason I can't pull up Column(2) data from the combo box.

Please help if you can

thank you in advance

titan
 
Hello,
thanks for the suggestion. I set the column count to 3 and it worked. when
I changed the ColumnWidth to 0", the combo box did not display the first
field drop down name( which i need the most) so I changed it to 2" and it
pushed the other fields out of the way so the ony way to see them is to use
the horizontal scroll bar on the bottom of the combo box.

If you think there is another solution so that its compeltely gone that
would be great, otherwise, thanks for all of the help

titan


Sprinks said:
Titan,

You *must* set the column count to 3 to have access to all three column
values. You needn't display them all, however--simply set the ColumnWidth
to 0" for the undesired ones.

As far as checking the value of Name of Violation, temporarily set the
ColumnWidths so that you can see the value of each field. If there is a
non-null value in Name of Violation, and on selection, it is not pushed into
the textbox defined by

Information.Column(2)

then I'm stumped.

Hope that helps.
Sprinks

titan said:
Thanks for the help.
I tested what you said. The column count was 1, so i changed it to 3, but
then all 3 field names came up. I was actually trying to get it so that when
the combo box option is selected, the corrosponding fileld names would go to
their respective places on the form. It works for the first one.(brief
description) (comumn 1) but not for Name of violation( column 2), if i call
both column (1) then it works in both fields but with the wrong information
in the second field (is the same information becuase they are both column 1
information. So somehow column 1 option works on both fields, but not column
2. how it is now , it just wipes out what was in there and places nothing in
its place. Im thinking now, that since its doing that, perhaps its placing a
NULL value in there, but Im not sure how to check and fix it.

if you could help i would appreciate it.

thanks in advance

titan


Sprinks said:
Titan,

The first thing I would check is that [Sections], [Brief Description], and
[Name of Violation] are all valid field names in Violations and that you've
spelled them as they're defined.

I would also check to see if the particular record you tested the combo box
on has a non-null Name of Violation field. It could be your code is
assigning the value properly but that it has no value.

Secondly, ensure that the combo box' Column Count property is set to 3,
otherwise, the last column won't be included even though it's in your
RowSource field list.

Lastly, you do not need code to display other columns of a combo box.
Simply set the textbox' ControlSource property to:

=YourComboBox.Column(index)

Hope that helps.

Sprinks

:

Here it is

SELECT Violations.Sections, Violations.[Brief Description], Violations.[Name
of Violation] FROM Violations;

thanks for the help

titan

:

Titan,

Please post the Row Source of your combo box.

Sprinks

:

Hello,
Here is the situation. I need to fill in two fields in a form after a combo
box choice is selected. I pulled in the 3 fields in the query that the combo
box is based on. The Combo box list, the Next field, and the one after that.

Next, I wrote the code that was given to me by stating that "The next field"
= Information.Column(1). and it works

"The one after that" = Information.Column(2) and it does not work

if I change it to column(1) for "The one after that" it works. so for some
reason I can't pull up Column(2) data from the combo box.

Please help if you can

thank you in advance

titan
 
You can set the width of each column in the ColumnWidths property, separating
them by semi-colons. So to display the 2nd column at 1", with the other two
non-visible, set the property to:

0";1";0"

Hope that helps.
Sprinks

titan said:
Hello,
thanks for the suggestion. I set the column count to 3 and it worked. when
I changed the ColumnWidth to 0", the combo box did not display the first
field drop down name( which i need the most) so I changed it to 2" and it
pushed the other fields out of the way so the ony way to see them is to use
the horizontal scroll bar on the bottom of the combo box.

If you think there is another solution so that its compeltely gone that
would be great, otherwise, thanks for all of the help

titan


Sprinks said:
Titan,

You *must* set the column count to 3 to have access to all three column
values. You needn't display them all, however--simply set the ColumnWidth
to 0" for the undesired ones.

As far as checking the value of Name of Violation, temporarily set the
ColumnWidths so that you can see the value of each field. If there is a
non-null value in Name of Violation, and on selection, it is not pushed into
the textbox defined by

Information.Column(2)

then I'm stumped.

Hope that helps.
Sprinks

titan said:
Thanks for the help.
I tested what you said. The column count was 1, so i changed it to 3, but
then all 3 field names came up. I was actually trying to get it so that when
the combo box option is selected, the corrosponding fileld names would go to
their respective places on the form. It works for the first one.(brief
description) (comumn 1) but not for Name of violation( column 2), if i call
both column (1) then it works in both fields but with the wrong information
in the second field (is the same information becuase they are both column 1
information. So somehow column 1 option works on both fields, but not column
2. how it is now , it just wipes out what was in there and places nothing in
its place. Im thinking now, that since its doing that, perhaps its placing a
NULL value in there, but Im not sure how to check and fix it.

if you could help i would appreciate it.

thanks in advance

titan


:

Titan,

The first thing I would check is that [Sections], [Brief Description], and
[Name of Violation] are all valid field names in Violations and that you've
spelled them as they're defined.

I would also check to see if the particular record you tested the combo box
on has a non-null Name of Violation field. It could be your code is
assigning the value properly but that it has no value.

Secondly, ensure that the combo box' Column Count property is set to 3,
otherwise, the last column won't be included even though it's in your
RowSource field list.

Lastly, you do not need code to display other columns of a combo box.
Simply set the textbox' ControlSource property to:

=YourComboBox.Column(index)

Hope that helps.

Sprinks

:

Here it is

SELECT Violations.Sections, Violations.[Brief Description], Violations.[Name
of Violation] FROM Violations;

thanks for the help

titan

:

Titan,

Please post the Row Source of your combo box.

Sprinks

:

Hello,
Here is the situation. I need to fill in two fields in a form after a combo
box choice is selected. I pulled in the 3 fields in the query that the combo
box is based on. The Combo box list, the Next field, and the one after that.

Next, I wrote the code that was given to me by stating that "The next field"
= Information.Column(1). and it works

"The one after that" = Information.Column(2) and it does not work

if I change it to column(1) for "The one after that" it works. so for some
reason I can't pull up Column(2) data from the combo box.

Please help if you can

thank you in advance

titan
 
Thanks a lot, it worked. I appreciate the help.

titan


Sprinks said:
You can set the width of each column in the ColumnWidths property, separating
them by semi-colons. So to display the 2nd column at 1", with the other two
non-visible, set the property to:

0";1";0"

Hope that helps.
Sprinks

titan said:
Hello,
thanks for the suggestion. I set the column count to 3 and it worked. when
I changed the ColumnWidth to 0", the combo box did not display the first
field drop down name( which i need the most) so I changed it to 2" and it
pushed the other fields out of the way so the ony way to see them is to use
the horizontal scroll bar on the bottom of the combo box.

If you think there is another solution so that its compeltely gone that
would be great, otherwise, thanks for all of the help

titan


Sprinks said:
Titan,

You *must* set the column count to 3 to have access to all three column
values. You needn't display them all, however--simply set the ColumnWidth
to 0" for the undesired ones.

As far as checking the value of Name of Violation, temporarily set the
ColumnWidths so that you can see the value of each field. If there is a
non-null value in Name of Violation, and on selection, it is not pushed into
the textbox defined by

Information.Column(2)

then I'm stumped.

Hope that helps.
Sprinks

:

Thanks for the help.
I tested what you said. The column count was 1, so i changed it to 3, but
then all 3 field names came up. I was actually trying to get it so that when
the combo box option is selected, the corrosponding fileld names would go to
their respective places on the form. It works for the first one.(brief
description) (comumn 1) but not for Name of violation( column 2), if i call
both column (1) then it works in both fields but with the wrong information
in the second field (is the same information becuase they are both column 1
information. So somehow column 1 option works on both fields, but not column
2. how it is now , it just wipes out what was in there and places nothing in
its place. Im thinking now, that since its doing that, perhaps its placing a
NULL value in there, but Im not sure how to check and fix it.

if you could help i would appreciate it.

thanks in advance

titan


:

Titan,

The first thing I would check is that [Sections], [Brief Description], and
[Name of Violation] are all valid field names in Violations and that you've
spelled them as they're defined.

I would also check to see if the particular record you tested the combo box
on has a non-null Name of Violation field. It could be your code is
assigning the value properly but that it has no value.

Secondly, ensure that the combo box' Column Count property is set to 3,
otherwise, the last column won't be included even though it's in your
RowSource field list.

Lastly, you do not need code to display other columns of a combo box.
Simply set the textbox' ControlSource property to:

=YourComboBox.Column(index)

Hope that helps.

Sprinks

:

Here it is

SELECT Violations.Sections, Violations.[Brief Description], Violations.[Name
of Violation] FROM Violations;

thanks for the help

titan

:

Titan,

Please post the Row Source of your combo box.

Sprinks

:

Hello,
Here is the situation. I need to fill in two fields in a form after a combo
box choice is selected. I pulled in the 3 fields in the query that the combo
box is based on. The Combo box list, the Next field, and the one after that.

Next, I wrote the code that was given to me by stating that "The next field"
= Information.Column(1). and it works

"The one after that" = Information.Column(2) and it does not work

if I change it to column(1) for "The one after that" it works. so for some
reason I can't pull up Column(2) data from the combo box.

Please help if you can

thank you in advance

titan
 
Back
Top