Combo Box Problems

  • Thread starter Thread starter ostermanp
  • Start date Start date
O

ostermanp

Guest
I have database1 which uses a table (Part Number/Description Table) linked from database2 to populate a combo box and a text field. The table in database2 includes part number (column(0)) and description (column (1)). Database1 has a combo box named Rosen PN which displays the part numbers and descriptions from a query (Part Number/Description Query) based on the table from database2.

In the AfterUpdate event for the combo box I have the following:

Private Sub Rosen_PN_AfterUpdate()
Me.Rosen_PN = Me.Rosen_PN.Column(0)
Me.Description = Me.Rosen_PN.Column(1)
End Sub

When choosing a part number from the list in the combo box everything works fine and both the Rosen PN combo box and the Description text box are filled in correctly.

My problem is if I try to enter a new part number using the keyboard into the combo box when I hit enter I get the following error message:

Run-time error '-2147352567 (80020009)'
The Field 'FAI Tracking.Rosen PN' cannot contain a Null value because
the required property for this field is set to True. Enter a value in this
field.

In the properties for the combo box "Limit to list" is set to No.

I should tell you that if you hit "End" on the error message box it will allow you to finish entering all of the information in the field and save the record.

Is there a way to be able to enter a number not in the list without getting the error message?

Paul
 
Hi Paul,

Not sure if this will work but what if you use;

Code:
DoCmd.SetWarnings False

and then of course to reverse it;

Code:
DoCmd.SetWarnings True

I am not sure if this will work and probably not a good idea as maybe the error should be addressed but you do say that you can then enter the info???

You have a strange error.

Robert88
 

Users who are viewing this thread

Back
Top Bottom