Combo Box Only Saving CourseNo - Not Saving CourseName

  • Thread starter Thread starter Robert T
  • Start date Start date
R

Robert T

Hi:

I'm ready to scream. We have a form with several combo boxes. One of those
combo boxes is cboCourseNo, it has a drop down list of the CourseNames but
it's actually using and storing the CourseNo. It works perfectly. It does
what we want, it enters and saves both the CourseNo and the CourseName. I'm
not sure how Access does that, but it does.

I had to create a 2nd data entry form that was almost identical to the first
form. However, on this form, cboCourseNo is correctly entering the CourseNo,
but the CourseName is left blank. That doesn't work because the CourseName is
a required field.

I've been trying to figure out what I did wrong with the 2nd form. I'm
hoping this is something obvious to any objective person looking at my
mistake.

Thanks,
Robert
 
Robert,
The cboCourseNo should be bound to yout table CourseNo.
Two columns, CourseNo and CourseName
Column properties...
NoOfCols = 2
ColumnWidths = 0", 2"
BoundColumn = 1
ListWidth = 2"
This cbo should only display the the CourseName, allow the user to
select by CourseName, display that CourseName after selection, but really
store CourseNo in the bound field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Please disregard this question. I had a very stressful day but on the train
ride home from work, I remembered how I constructed the cbo in the first
form. I used an After Update script to fill in the value of the 2nd field.
Under the stress of a difficult day, I forgot about that.

Robert T
 
Good Morning Al:

You wrote:
[This cbo should only display the the CourseName, allow the user to
select by CourseName, display that CourseName after selection, but really
store CourseNo in the bound field.]

Al, maybe I didn't explain it correctly, but that's exactly what I did. It
worked like a charm for months with the original form, but it wasn't working
right with the 2nd form. I completely forgot about the AfterUpdate script
that inserts the CourseName into the table, thereby giving us 2 fields with
one entry on a drop down.

Thanks for the advice,
Robert
 
Robert,
You actually don't need to (and shouldn't) bother saving the CourseName.
Since you've captured the "unique key value" CourseNumber in the combo, you
can always re-derive the CourseName from your table "on the fly" in any
subsquent form, query, or report.
If you were to capture a CustomerID, it would not be nececessary to also
capture the Address, City, State... etc... on your form. Just "display"
them...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Hello Al:

In general I would agree with you, however, I think this is one of those
scenarios where seeing the course name helps the members of our training
team. It's a Many to Many relationship and I prefer storing the actual name
of the course [in addition to the CourseNo] in the linking table. Yes I know
we could query for the data if and when we need it, but it helps us when
looking at the linking table to always see the Course Name.

I know it violates the 2nd or 3rd rule of Normalization, but we find it's a
nice little convenience. It certainly doesn't cause much of a performance
hit.

Nonetheless, your advice was right on the money and I appreciated it.

Robert
 
Robert,
I know what you mean...
Capturing the CourseName is not a serious problem. I thought I'd
mention that as a matter of course...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


Robert T said:
Hello Al:

In general I would agree with you, however, I think this is one of those
scenarios where seeing the course name helps the members of our training
team. It's a Many to Many relationship and I prefer storing the actual
name
of the course [in addition to the CourseNo] in the linking table. Yes I
know
we could query for the data if and when we need it, but it helps us when
looking at the linking table to always see the Course Name.

I know it violates the 2nd or 3rd rule of Normalization, but we find it's
a
nice little convenience. It certainly doesn't cause much of a performance
hit.

Nonetheless, your advice was right on the money and I appreciated it.

Robert

Al Campagna said:
Robert,
You actually don't need to (and shouldn't) bother saving the
CourseName.
Since you've captured the "unique key value" CourseNumber in the combo,
you
can always re-derive the CourseName from your table "on the fly" in any
subsquent form, query, or report.
If you were to capture a CustomerID, it would not be nececessary to
also
capture the Address, City, State... etc... on your form. Just "display"
them...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your
life."
 
Bob:

Good point Bob, but I have to clarify my previous statement.

When I said it helps "us", I was referring to it's impact on the team. I am
the only one who actually looks at the tables in datasheet view, everybody
else uses forms. Once again Bob, when I said I used the word "us", I meant
the team benefits when I look at the linking table and see the course name.

Although it probably sounded as if other members were looking at the tables
in datasheet view, that was not my intent.

Robert
 
Back
Top