mr_suleyman
26th October 2005, 17:20
Hi All Dear friends , I have been designing a new module like maintain Purchase Requesiton. I have one big table for maintain my purchase requestions. Primary field of my table is order_no. When user add new record it gives number to order_no. When user press insert data button, my program calculates order_no value. In my form user may change this number . At this point my aim is that when user save button on the form , my form should't take care of order_no field value , In my program I should give automatic number to it and form should tka care this value. How can I achive this. In my form I don't want to restrict order_no field. User can insert number to it, but when he saves the maintain form, form should take care of my calculation value for order_no field.

Thanks for your advice.

mark_h
26th October 2005, 21:15
(1) Not sure I understand the problem. Are you saying that when the user hits the insert button the order number is populated and then you want to allow the user to type over this field? If so then you just need to put something in the check input to make sure the number is unique for your index.
Or
(2) Are you saying the user hits insert, you populate the order number, the user hits save and saves the order number. Now you want to let the user go back and change the order number?

mr_suleyman
27th October 2005, 14:07
I mean that When user press insert data button , I calculate order_no and put it order_no field on the form . THis field's value I calculated can be erased or changed by user. In this condition, when user press save button order_no field take into considaration my calculated value and save this value to my purchase table. I achived this by using attr.input = FALSE but then when user press find data button on form
user couldn't write values to this order_field value and user couldn't use FIND button ecent on my form. That is why I didn't use attr.input event of order_no field. then FIND button event works well. (order_no is primary key of my table) . On the other hand, user can write something over my order_no value that program calculates and then when user press save button, it saves user's value on order_no field. It doesn't take care of my values.
I add this tdsls984.orno = ***** (my calculation) but form saves user's writing value.

HOW CAN ACHIVE THIS PROBLEM .
THANK YOU ....

mark_h
27th October 2005, 16:35
I think you can do something like this:

field.sometable.orno:
before.input:
if update.status = add.set then
......calculate order number....
display order number
attr.input = false
endif

baanprog
27th October 2005, 17:09
Hi,

You can also enable the filed even while using attr.input=false, when you write something like

if not choice=def.find then
attr.input=false
endif

the choice is def.find or find.data , Iam not sure please check.

Regards

mr_suleyman
28th October 2005, 08:18
Thanks MARK and Baanprog. I use both of your suggestions. IT works well.

Best Regards....