Delete record on form gives Invalid Use of Null error

J

Jeff Byrd

I have a form that I have the OnCurrent event set to set the Record Source
of a combo box to a query based on the data in anohter field. This is done
to only allow the combo box to give them options apprpriate to the data in
the other field.

I have a button programed to delete the record when clicked on. When you
click on it it will give you an error message that says "Invalid use of
Null". It lets you click on OK and them proceeds to delte the record. If I
remove the OnCurrent Event that sets the Record source and then click Delete
there is no Error Message.

What cod can I add to my delete button that will keep this error message
from appearing?

Thank you.
 
P

PC Datasheet

Rather than set the recordsource of the combobox in the form's Current
event, set it in the Enter event of the combobox and your error should go
away.
 
J

Jeff Byrd

Thanks Worked like a charm.

PC Datasheet said:
Rather than set the recordsource of the combobox in the form's Current
event, set it in the Enter event of the combobox and your error should go
away.
 

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