Solved How to set up unique customer codes based on customer types (1 Viewer)

It would appear so, so you would get all but the first character of that control.
Honestly, you are just creating work for yourself.
I deal with systems and I get to see simple codes as Welsh095, which is good enough to identify the customer.
You would be Aster096, if you joined straight after me.
 
I added the Me.CusoterCode argument part before the Len but I still get the error at the same Right spot
Access hates me :(
 

Attachments

  • error3.JPG
    error3.JPG
    44.9 KB · Views: 26
Gasman is correct. Sorry about that. Try:
Me.CustomerCode=Left(Me.CustomerType,1) & Right(Me.CustomerCode,Len(Me.CustomerCode)-1)
 
No, because you are not looking up the syntax, just making it up as you go along.
I know of someone else that does that and he has been using Access for almost 20 years. :-(
Look up the syntax and see if you can work it out yourself, or look at the Left function. The right and left has the same syntax, the Mid() is slightly different. Regardless, Google the syntax, that is the only way you will learn.
We all make mistakes, and LarryE has done so in this case, but you always need to understand any code supplied to you.
 
No, because you are not looking up the syntax, just making it up as you go along.
I know of someone else that does that and he has been using Access for almost 20 years. :-(
Look up the syntax and see if you can work it out yourself, or look at the Left function. The right and left has the same syntax, the Mid() is slightly different. Regardless, Google the syntax, that is the only way you will learn.
We all make mistakes, and LarryE has done so in this case, but you always need to understand any code supplied to you.
I typically do, and you are right, I didn't in this case. I just needed a coma and not (). I apologize
Do bare in mind that I started about a week ago and I built this monstrocity of a database, so it's not easy for me to understand everything.

I do have another question about order sums. Should I make another post? I thought it would be the same problem format but it seems it's not
 
Do bare in mind that I started about a week ago and I built this monstrocity of a database, so it's not easy for me to understand everything.
That does not sound like it is going to go well. :(
 
I started about a week ago

It occurs to me that something VERY useful should be undertaken very soon. If you have not previously studied "database normalization" then you need to find a few articles on this subject and study them sooner rather than later.

IF you search this forum for "normalization" you will find articles discussing this subject. If you search the general web, you need to qualify it as "database normalization" since normalization occurs in about half-a-dozen different topics including math, chemistry, politics, psychology, medicine... just be selective in your general search.
 
I typically do, and you are right, I didn't in this case. I just needed a coma and not (). I apologize
Do bare in mind that I started about a week ago and I built this monstrocity of a database, so it's not easy for me to understand everything.

I do have another question about order sums. Should I make another post? I thought it would be the same problem format but it seems it's not
It would probably be a very good idea if you could take a screenshot of your Relationship window and post it. Maybe someone could make recommendations, so you don't run into even worse problems later.
 
Honestly the randomness is not the problem so please try to see past it.

Honestly, depending on the RND() function to deliver anything unique is a problem so try to not gloss over it. I don't want to become condescending about this, but I've been doing computing things in labs, industry, home projects, and for the U.S. Government for over 55 years. When I tell you that randomness is a problem if you were looking for uniqueness, MAYBE you should ask yourself if it is POSSIBLE that I actually am giving you good advice. This is as polite as I can say it. Pat Hartman also tried to politely warn you about the RND function for this purpose. For some reason you have "random" in your head - but true randomness has NO GUARANTEE of uniqueness. ZERO guarantees.
 
asteropi,

This thread is marked SOLVED--- what is the solution? It could be helpful to others. Please describe.
 

Users who are viewing this thread

Top Bottom