|
-
Jul 4th, 2003, 03:01 AM
#1
Thread Starter
Lively Member
Strange problem - Need Expert help
Hey guys,
On a Point of Sales form i am writing for a company i have hit a hurdle.
Heres how it goes:
Their sale number format is as follows:
S03A100
the above number would indicate that the sale is the 100'th sale in January 2003
S - Sale
03 - Year
A - Month
100 - n'th sale that month.
Ok.
Now i have a label with the sale number in it and a command button either side (a left button and a right button) emulating the data control.
i have the left button decreasing the sale number by 1 and showing the details of that sale on the form, and obviously the right button increases the sale number.
the problem is this:
for example when i hit sale 1 for any given month (ie S03B1) i need it to kick over to january (A) and go to the last sale made in january.
and the same going forwards in sale numbers and also when the year changes.
I cant for the life of me work out how to do this.
Sorry for the odd explanation but it needed a little background info to see the problem.
Anyone got any ideas on how to solve this one?
Any help would be much appreciated.
Thanks in advance
nightshift
PS. ALl the info for the sales i need is stored in various databases, and they are running SQL Server 2000, just incase that helps
-
Jul 4th, 2003, 03:30 AM
#2
To do soemthing like that the commnadbuttons have to be a bit "smart".
You must always know how much Sales there are for the actual month.
Example :
move up:
is the actual Salenumber the last of this month then CHECK: is actual month Decmber then change to next year, January ELSE change to next month. Change the Salenumber to 1
move down:
is the actual Salenumber 1 then CHECK: is the actual month Januar than change to December and Year to previous year and Salenumber to maxnumber of Sales in this month ELSE change month to previous month and Salenumber to maxnumber of Sales in this month .
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|