VB to Verify Update

R

Rick

OK, this is getting crazy. Here is what I tried. I took
the suggestion of having the combo box pull the
information previously mentioned and my primary key,
EmployeeID. Here is what I did:

The combo box updates my Supervisor feild with the
Supervisors EmployeeID. I have a hidden text field
already in the form for EmployeeID and I created my VB
using this:

If me.Supervisor = Me.EmployeeID then
.......

Well, it isn't working and I don't understand what's going
on. I unhid the EmployeeID to verify the information in
the EmployeeID and Supervisor fields matched. They do,
both show 35 but I don't get a message box I asked VB to
return if both fields returned the same value.

Is it possible the value of the Supervisor contains more
than just the Supervisors EmployeeID of 35? My drop box
has two colums but I only show one. Can the value of both
colums be dumped into the Supervisor field but only show
the Supervisor EmployeeID? (The other information in the
drop box is what I mentioned in my first posting.)
 
J

John Vinson

Is it possible the value of the Supervisor contains more
than just the Supervisors EmployeeID of 35?

No; the Value property (the default, what you'll see if you just refer
to the combo box name in VBA) is the value of the Bound Column. This
isn't necessarily, or even commonly, the value displayed in the combo
box.

Check the combo's properties. What are its RowSource? What is its
Bound Column? (For example, if the Bound Column is 1, the value of the
combo will be the first field in the Rowsource query)? What is its
ColumnWidth property? (Ordinarily you'ld set the width of the ID field
to 0 and the width of a human-meaningful name field to nonzero, so the
computer sees the ID and the person sees a name).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top