Is this the same question as you asked in your previous thread? If so, please don't start a new thread. You might want to look at the sample database on Roger Carlson's site.
So for today's date, you may just ask:
[tt]
Select Format(First, '00') & Format(Second, '000') As BusKey
From MyTable
Where MyDate = #Date#
Order By PK
BusKey
01001
02002
03003
04004[/tt]
This is just a wild guess...
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
Apparently you want to create you own autonumber over the selected value from the combo box restarting each date with 001. Did you look at the sample in the link I posted?
Without any user interaction" - so that's not true, user will have a combo box to (interact) choose 01, 02, 03, 04, or 05 from...
it looks like you can still use a table like this:
[pre]
PK Castumer_Number Seq_Number Seq_N2 MyDate
1 1 1 1 4/6/2015
2 2 1 2 4/6/2015
3 3 1 3 4/6/2015
4 4 2 1 4/6/2015
5 5 2 2 4/6/2015
6 6 2 3 4/6/2015
[/pre]
And concantinate and format Seq_Number (like I have in my previous post) and Seq_N2 for any given day to give you the 01003 sequence number. With any new Customer it is easy to add to this table, just use [tt]MAX(Seq_N2) + 1[/tt] to get the next record/sequence.
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.