Data Handleing

  • Thread starter Thread starter Sean
  • Start date Start date
S

Sean

Hello, I have a form that is part of a PO system. I need to be able to say
whether or not the PO has been ordered, and if so have it change the
appropriate records in the inventory. I was thinking that a yes/no check
box was my best bet, but I am not sure how to make it work. Basically I
want to be able to check the box and the data associated with the PO be
calculated in the rest of the DB as normal. If it is not checked, I want
the data to remain there but not update the rest of the database. Thanks
for your help on this.

Sean
 
The most general way of handling this is never to *change* inventory levels.
It may mean some design changes though.

What you do is hold an inventory level as the physical count at the last
stocktake, and its date. Then when an order is filled, add a record to a
goods inwards table, and the date. Similarly for goods outwards, add a
record to an outwards table, and the date. Then queries based on date
comparisons get you total goods inwards and outwards after the last
stocktake. The query calculation stocktake + inwards - outwards gives you
the current inventory at any time.

Sometimes it may be simpler to have only one stock movement table, and
assign positive numbers for inwards and negative for outwards.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Sean,

I am going to assume that the PO data in the form is saved
in the database, but that some other process is performed
on the dta when the PO is actualy "Ordered".

A Check Box control is useful, but it may not suffice on
its own. I imagine a user would be able to check and un-
check the box multiple times, so what happens then?

As and laternate solution, I would add a Boolean (yes/no)
field to the PO record in the database, and a Date field
as well. Initialy the Boolean field would have a Default
Value set to False, and the Date Field can be Null.

On your Form, I would put an Empty Lable and a Command
button. The Command Button Text could read "Process PO"

Click the command button to call a function to perform
whatever process is required when sending a PO. At the
conclusion of this function, set the Boolean Field to True
and load the current Time/Date into the date field.

Create an event procedure for the On Current event. This
procedure should check the value of the Boolean Field.

If False, set the Lable text to a empty string and Enable
the Command Button.

If True, set the Label Text so something like "PO
Processed" followed by the Time/Date value, and Disable
the command button.

One final thing. The last thing your process function
should do is recall the On Current event so as to update
the current record in the form view (ie, set the lable and
disable the commabnd button)

When you are finished, you should be able to navigate
through the PO records, and the Lable and command button
status will change accordingly.

Rob
 
Thanks for your help.

Sean

Rob Love said:
Sean,

I am going to assume that the PO data in the form is saved
in the database, but that some other process is performed
on the dta when the PO is actualy "Ordered".

A Check Box control is useful, but it may not suffice on
its own. I imagine a user would be able to check and un-
check the box multiple times, so what happens then?

As and laternate solution, I would add a Boolean (yes/no)
field to the PO record in the database, and a Date field
as well. Initialy the Boolean field would have a Default
Value set to False, and the Date Field can be Null.

On your Form, I would put an Empty Lable and a Command
button. The Command Button Text could read "Process PO"

Click the command button to call a function to perform
whatever process is required when sending a PO. At the
conclusion of this function, set the Boolean Field to True
and load the current Time/Date into the date field.

Create an event procedure for the On Current event. This
procedure should check the value of the Boolean Field.

If False, set the Lable text to a empty string and Enable
the Command Button.

If True, set the Label Text so something like "PO
Processed" followed by the Time/Date value, and Disable
the command button.

One final thing. The last thing your process function
should do is recall the On Current event so as to update
the current record in the form view (ie, set the lable and
disable the commabnd button)

When you are finished, you should be able to navigate
through the PO records, and the Lable and command button
status will change accordingly.

Rob
 
Back
Top