Problem with Combo box and Null

N

NNlogistics

I have a form with 3 combo box's that can select a part id that will appear
in a locked text box. The combo box's use differnt variations of the same
query(Part numbers that start with 4 the next for P/n that start with 5 and
the last with 3. The problem of course is that after selecting any of the
combo's the Part number appears in all of the combo boxes.

I tried to use the 'after update' event to clear the other combo boxes.
Private Sub cmboSelectStopperProductCode_AfterUpdate()
Me.cmbSelectRolledCork3_ProductCode = Null
End Sub

I also tried "" for null
I get runtime error 21473552567 You tried to assign the null value to a
variable that is nota varient data type
whether the combos are bound or not I get the same problem.
I tried the suggestions mentioned in other threads

So in short I want to clear the 2 other combo boxes when I selct the 3rd
combo box. I hope I made that clear.

Thanks for any help
 
J

Jeff Boyce

I can't be sure from your description, but it sounds like you have all three
combo boxes "bound" to the underlying PartNumber field. It shouldn't be a
surprise that, when the record gets pulled into the form, any/all combo
boxes bound to the PartNumber field shows the part number!

Another approach would be to have NONE of the combo boxes bound. Your form
could simply use them to help the user identify which record s/he wants.
You could use a locked textbox to display the PartNumber (that one would be
bound).

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
N

NNlogistics

Thanks, Jeff
I understand that having them bound will display the underlying data in all
the boxes. However,even if I make the combo boxes unbound, when I try to
clear the combo boxes ' using the code I described, I get the same error. My
objective is to make the choice on one of the boxes and then clear the other
2.
 
J

Jeff Boyce

I'm not sure how to do that ... if I were setting up a multiple choice
situation like yours, I'd be inclined to use an Option Group to select which
type of lookup, then a single combo box to provide the search values (using
the Option Group to change the RowSource of the combo box).

Best of luck

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 

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

Top