Retaining drop down value for next record

Code looks OK to me, but it depends on what is in the fields when that code is run.
If I was using that form, I would expect to have to select Copy and then enter my data. I would then leave it selected until I wanted to clear the fields, so I would only ever touch that field once in a while. The first time I used it, there would be nothing to copy and it would clear the fields when I deselected it.

Also you do not need two If statements, you could use the Else statement for when it chkCopy is set.
 
I see what you told me - commenting out code in error. Thanks! In the add code I now set the chkCopy to TRUE - so it always go goes back to that. However, now, after setting if off and picking the data I need for an add, and the add screen comes back up with copy re-checked, only 3 of the 4 fields are repeated - NOT the customer field. I'm stumped on that?
 
What I would do in that situation is walk through the code setting breakpoints where needed, to find out what is happening.

I think you are over complicating things now. I would let the user be choosing when the Copy checkbox is selected/not selected and remove the need for extra code and working out when and when not it should be set.

You are setting it now each time you add a record, negating the need for it to be there any more and testing for it in the afterupdate events.

Check you have not altered the code for Customer and walk through the code. It also helps to show you the events in their order of execution.
 
I can and should do that - but don't know how to begin?
 
I can and should do that - but don't know how to begin?

Are you referring to walking the code and breakpoints?

http://www.techonthenet.com/access/tutorials/vbadebug/debug01.php

Be sure to walk through the tutorial using Next at the bottom of each page.

Check your code first though as there might just be a typo.

When you finish an event, you will need to switch back to the form to carry out the next action.

Fisrt place to start would be a breakpoint in the errant event of the Customer listbox.

HTH
 
Gasman, thanks ONCE AGAIN. Found my coding error via the debug!
 

Users who are viewing this thread

Back
Top Bottom