Well, instead of:
[type table]!typename & Format([qa table]![auto numb],"000000"
I'd try:
[type table]!typename & cstr([qa table![auto numb])
because cstr will always convert the number to a string, no matter how many digits.
But still, your version is not causing the problem, I think, even if it is somewhat risky.
Now, the most likely cause of your problem is that you failed to properly quote the string that you are creating. Strings have to be in quotes in an SQL statement, and you can use single or double quotes, as long as you use the same one at the beginning and end of the string.
So, what you should be using is something that looks like this:
"'" & [type table]!typename & cstr([qa table![auto numb]) & "'"
Note how you can quote a single quote by enclosing it in double quotes. The reverse is also true.
Another way:
"""" & [type table]!typename & cstr([qa table![auto numb]) & """"
I know that looks weird, but it works. I forget why.
"I have several books. Alot of them use autonumber for a unique pk." Well, I've seen misinformation in print before. And now, so have you!
"None of these tables have pk's. so conversion to SQL would be a bear." No, that's not the problem. The problem here is that I wouldn't bet you a plug nickel that your data is reliable. And yes, since this app is "rather crucial to our business", I *would* be loosing sleep over it if I were you. You have an important app, written by amatuers. Look at it this way: would you hire a kid with a hammer to build you an addition to your house? Well, you did. Yep, methinks you got problems. And if you don't already know that you gotta quote strings in SQL, you aren't going to be able to wip this one into shape in any reasonable time.
Doing a realiable, industrial-strength Access app is not something that you, or anyone else, can do right out of the gate. I shudder to think about the crap I foisted on the world 9 years ago. No matter it was the best I could do at the time, it was still crap. I ought to know, I think, because my Access experience goes back 9 years, my db experience is a few years more than than (I've even had to roll my own simple DBMS when I was a wee lad), and I've been programming, and nothing but programming, almost 28 years now. I know good when I see it, I know garbage when I see it. I can see the pitfalls and problems from quite a distance because I've fallen into them myself a few times. It just what comes from doing one thing for more than half your life.
Best advice I can give you: don't touch the thing again. Go find yourself an experienced Access programmer and pay him to either fix or rewrite the app. And then sleep well.
Look, if it was just a school project or something, I wouldn't be so harse. But you are betting your business on this thing and it doesn't seem to be bet that's in your favor. You don't seem to be an Access professional. You are running a business. That's what you know how to do. Stick to it. Get someone who know Access to do your app. It will be expensive, but going bankrupt because you can't reliable track your business is more costly.
As a great Hollywood hero once said, "A man's got to know his limitations."
Peleg
PelegNOSPAM@PStrauss.net