deaking with nulls, I think...

  • Thread starter Thread starter Jim May
  • Start date Start date
J

Jim May

the below code is bombing if it finds a null in a field of my lookup table;
how can I prevent this?

Private Sub cbVenCode_AfterUpdate()
Set MyVenTable = Range("VenTable")
txtVenName.Value = Application.VLookup(Me.cbVencode, MyVenTable, 2,
False)
txtVAdd1.Value = Application.VLookup(Me.cbVencode, MyVenTable, 3, False)
txtVAdd2.Value = Appliction.VLookup(Me.cbVencode, MyVenTable, 4, False)
txtCity.Value = Application.VLookup(Me.cbVencode, MyVenTable, 5, False)
txtSt.Value = Application.VLookup(Me.cbVencode, MyVenTable, 6, False)
txtZip.Value = Application.VLookup(Me.cbVencode, MyVenTable, 7, False)
End Sub
 
Never mind,,,
just discovered miss-spelling of application in my faulty line
txtVAdd2.Value...
Jim
 
Thanks for responding to your own question, sure beats
adding unnecessary ON ERROR conditions.
 
Back
Top