You have to split your reference number into an alphanumerical and an numerical part if you do want to have alphanumerical identifiers.
As far as I know, it is not possible to increment alphanumerical identifiers you want to have!
Thats why I would proceed this way.
Another way is also possible.
Let's assume you have all your records with these alphanumerical identifiers in one table.
You would then have a field for the alphanumerical part, say "category" ; this field will contain the 'A', 'B', ...'X' values
Another field would contain the numerical part , say "num_id"; this field will contain the '250', '295', ...
When you want to add a new record in your table, you first calculate the max_value for the numerical part, if the alphanumerical part is known:
select max(num_id) from datatable where category = 'A'
You increment this value, and use it in your insert statement:
insert into datatable values ('A', $new_max_num_id, $data1, $data2, ...)
If this works will depend largely on how your database is made!
If your identifiers are possibly spread over multiple tables, and any of these tables can hold the max value, you will get into trouble with the previous code; in this case, you should prefer the way I described in my previous post.
If your max_value is always supposed to be found in the same table, this way could work.
However, if one day things change and other tables can have the max_value, you will have to change the design in productive use, rewrite your code, fill a table with the max_values, etc. which would be likely to cause you lots of trouble !
HTH
JJ Mouris