please help me URGENT!!!

D

dimple

My access project i need help;
Firstly, if i have a fieldname "material no" of course this is number, but i
need to this number 8 digit and it must start with 183 or 184
For instance 18478690 or 18398724 when users write in form different number
give a msg like your number must start with 183 or 184. How can i do that.
Second, I have a serial num this is like a counter but this is workin
backround but its first two number must same like first questıon. In addition
when I will ctrl-alt-F3 a new little window open and i will type the first
two number and then the number increase 1 when the new no typing
for example After ctrl-alt-F3 I write 50 then the serial number start
500000 after new record its 500001 and etc. After ctrl-alt-F3 again and type
45 the number is 4500001... or the number 45 have record before the new
number=last number+1
This is very important for me i need it for my database lessons project
please help me!!!!!!
 
D

Dave

dimple said:
My access project i need help;
Firstly, if i have a fieldname "material no" of course this is number, but i
need to this number 8 digit and it must start with 183 or 184
For instance 18478690 or 18398724 when users write in form different number
give a msg like your number must start with 183 or 184. How can i do that.

its usually better to prevent incorrect entries than to scold users for
doing something wrong. try looking at input masks.
Second, I have a serial num this is like a counter but this is workin
backround but its first two number must same like first question. In addition
when I will ctrl-alt-F3 a new little window open and i will type the first
two number and then the number increase 1 when the new no typing
for example After ctrl-alt-F3 I write 50 then the serial number start
500000 after new record its 500001 and etc. After ctrl-alt-F3 again and type
45 the number is 4500001... or the number 45 have record before the new
number=last number+1

start coding... learn how to grab that key combo, display an entry form or
box, format the starting number and either do an autonumber by setting the
starting number, which is pretty ugly, or take over the appropriate events
when a new record is created on your form and insert the next value you want
to use.
 
N

Nick Coe \(UK\)

I'll try and point you in the right direction but I won't do
your lesson for you.

Refer to "material no" as [material no] then you won't have
trouble with the space in it.

[material no] might be better as a string/text field if it
is a part number otherwise how do you deal with a part
number '258663-9HG-MH513' ?

Look in Access Help for AfterUpdate event and Left() for
starting with 183, 184. (Hint - Left([material no],3)

Serial number might be better as two fields which you can
concatenate for display (look up & in the Help).
[SerPrefix] for the two numbers and [SerCount] for the rest.
It's tricky to reset an auto increment field so you'll have
to manually add 1 see AfterUpdate event again and think
about how to ensure unique serial numbers (Hint - index).

I think you've left this to the last minute. Lazy sod. How
do I know? Trust me, I procrastinate for England at
international level.
 
J

James Hahn

If that field must be numeric and 8 digits, then you simply need to test
that it's greater than or equal to 18300000 and less than 18500000.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top