event being triggered but not sure why

pb21

Registered User.
Local time
Today, 08:22
Joined
Nov 2, 2004
Messages
122
I have a change event on a combo box that is being triggered after I have finished and try to save.

The combo is used to lookup descriptions and place the error code in an excel cell.

its generating error 91 runtime error as object variable not found:

its the = Activecell.address line on the if statement that causes the error as there is no active cell selected as the user finished enetering data from the combo.


any ideas?




ComboValue = Me.cbErrorPicker.Value

Dim cell As Range
For Each cell In Range("G11:AC47")
If cell.Address = ActiveCell.Address Then
' "In range"
If (ActiveCell.Value <> "") Then

Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then ' User chose Yes.
MyString = "Yes" ' Perform some action.
ActiveCell.Value = ComboValue
Else ' User chose No.
MyString = "No" ' Perform some action.
End If

Else
ActiveCell.Value = ComboValue

End If

Else
' "Not in range"

End If
Next cell
Set cell = Nothing
 
In this instance I dont want the event to happen if a cell is selected its going to try and put a value in a cell when I save.

I did read somewhere that controls from the design toolbar has issues with events being triggered adhock.

should i try and create the control with a button and then delete the control altogether when the user has finished entering data? that option seems a lot of work though.

regards
 
I'm not really sure... every time I do something from access to excel, it works for me. :o So I don't really have much experience in debugging. Maybe someone else knows? ----- Pat... you there?
 

Users who are viewing this thread

Back
Top Bottom