>I have users that input these data into a form at the same time:
>
> Machine Start Time End Time
>user 1 01 1430 1545
>user 2 02 1500 1630
>user 3 01 1600 1648
>etc.
>
>If by mistake user 2 inputs Machine 01 (it's already working)
>
>How do I prevent that data from being stored using the insert sentence ?
>There is no primary key to compare user's input.How do you know it's already working so it's a wrong entry? Because it fits in the current time?
Do a query before inserting to see if the current time fits in a slot for the machine number you want.
Something like
nMachine = 1
mytime = strtran(left(Time(),5),":","")
cSQL = "select * from mytable where machine="+transform(nMachine);
" and dt between StartTime and EndTime"
or you can say dt < = EndTime and dt > = StartTime
If you get a record returned then it's already in use.
This assumes time in the current day, as per your data sample.