I have 3 tables called Input, Daily Production, Preventive Maintenance.
In INPUT TABLE FIELDS ARE MENTIONED BELOW:
IP_PRTNUMBER - PART NUMBER,
IP_PRTNAME - PART NAME,
IP_CAVITY - CAVITY,
IP_CYCTM - CYCLE TIME,
IP_QTY - QUANTITY,
IP_PLAN_DTFM - PLAN DATE FROM,
IP_PLAN_DTTO - PLAN DATE TO,
IP_PLAN_MNTH - PLAN MONTH,
IP_MCNUM - MACHINE NUMBER
Here I want to know if I entered the PLAN DATE FROM field I need to get PLAN DATE TO (date) automatically. So how to give the formula and where do I need to give that?
The formula is mentioned below
There is no computed fields in an Access table so you'll have to create/update the value of the field IP_PLAN_DTTO when the value of the related fields (IP_QTY, IP_CYCTM, IP_CAVITY, IP_PLAN_DTFM) changes. This is done on a form, using the AfterUpdate event of the controls bound to the different field. Ex:
Private Function Compute_IP_PLAN_DTTO()
Me.IP_PLAN_DTTO.Value = (((Me.IP_QTY.Value / (79200 / Me.IP_CYCTM.Value) * Me.IP_CAVITY.Value)) + Me.IP_PLAN_DTFM.Value)
Private Sub IP_CAVITY_AfterUpdate()
Private Sub IP_CYCTM_AfterUpdate()
Private Sub IP_PLAN_DTFM_AfterUpdate()
Private Sub IP_QTY_AfterUpdate()
However storing a computed value into table is not recommended because it is not dynamic (nothing garantees that the computed field will be updated when the value of a related field changes) and sooner or later it causes data inconsistencies. The canonical solution consists in creating a query that selects the required columns and adds the computed one. So in your case:
SELECT IP_PRTNUMBER, IP_PRTNAME, IP_CAVITY, IP_CYCTM, IP_QTY, IP_PLAN_DTFM, ((([IP_QTY]/(79200/[IP_CYCTM])*[IP_CAVITY]))+[IP_PLAN_DTFM]) AS IP_PLAN_DTTO, IP_PLAN_MNTH, IP_MCNUM
How you can find a date as the result from that formula is one thing I cannot understand, though. You'll probably have to use a format or casting function to convert the resulting value to the proper data type.
If I understand your question correctly, you want to create in VB (or VB.Net) the same application as the one created in Access. Unfortunately there is no direct correspondence between forms and controls in Access and forms and controls in Visual BASIC. The main difference is that Access forms and controls are "data aware", i.e. they have properties that can bind them directly to a data source (RecordSet). In VB and VB.Net you need to use other solutions to create a data flow between a form and its controls and a data source. These solutions require additional objects and more code than with Access.
To keep it short, the principles are the same but the techniques are slightly different. You'll probable receive more help in a forum dedicated to VB/VB.Net for questions concerning the use of these programming environments. See for instance: VBForums - Visual Basic and VB .NET Discussions and More!