Edit table through a form

And be warned some things like auto-updating of tables takes place which can cause bad data to get into your database which is just one of the headaches of bound controls I am stating this mainly as an answer to vbaInet's question. There are others but I do not recall them all off the top of my head any more -- I just learned to avoid them back when I was getting my certification in MS Access development.

Oh and the newbies I teach are rarely programmers they are generally people that have never programmed in their life and some are even scared of the thought of it. But they quickly find out that actual programming is fairly easy to do once you have the basics down (which do not take long to learn -- no longer than it takes to learn the basics of bound controls). Bound controls were mainly developed to aid in quicker development not necessarily better development which is why I reserve them for jobs that have to get done yesterday.

The sophistication of bound controls brings with it is own issues and I have found that the newbies I teach how to do the basics via straight VBA have a much easier time of it going forward. What may be interesting is that I can show a newbie atypical developed Access/Excel programs and they will struggle with the concepts of bound controls and some of the other rather cryptical native coding elements of those two forms of VBA while the more straight forward coding is fairly easy to follow and understand. This is mainly because the stuff going on under the hood is invisible to them.

But again its to each their own I suppose -- if you are solidly into using the native elements of Access/Excel VBA then by all means use it. I am just putting out the danger sign that its thin ice, but you can skate on that lake all you want and because its a big lake you may never experience one of those spots where you fall through.
 
Okay I found the issues -- you were setting some of the values incorrectly and then you were doing the Requery on the wrong Form

I have cleaned up the code added a few items that you should always have (aka Errorhandlers) and set it so your Comboboxes are based on table data instead of hard coded values. As well as a few other minor things to help facilitate learning the how.

If you have any questions just drop me a line.
 

Attachments

@DennisOJensen. Thank you for looking at the database im currently working on.

I have tried to use the database but some of the command buttons do nothing. I can not add or update data in the table via the form.
 
Did you use the one I posted ? Back to you ?

I am pretty sure I gave you the new one. Does the new one have 3 tables now?

I mean I tested it and got the cmdAddUpdate button -- Update functionality working and figured I would let you test the rest.
 

Users who are viewing this thread

Back
Top Bottom