PDA

View Full Version : forms navigation



sindhuja
01-30-2009, 08:24 AM
Here is my query?.

Form 1 with fields like activity, starttime, end time, cycletime and buttons like main menu, activity entry
We need to select the activity combo box. On selection of activity the start time and cycle time starts. Then we need to select the activity entry button which will open Form 2 and we need to enter the counts on that form. On saving the Form 2 the cycle time in Form 1 gets refreshed with is the concern. So am not able to calculate the actual time taken for each activity

Is there a way to avoid this or any idea to calculate the actual time?

-Sindhuja

CreganTur
01-30-2009, 08:37 AM
Well... there are a couple of options I can think of:

1) If StartTime and CycleTime are values in a table, then you can simply update the table values. independently- update StartTime in Form1, and update CycleTime in Form2.

2) If Form1 remains open while Form2 is open, then in your code for Form2 you can work with objects on Form1 using the Forms!FormName!ObjectName convention.

Does that help answer your question?

sindhuja
01-30-2009, 10:08 AM
Thanks for the response...

Starttime and end time values are not the table values. Once i open the Form 1 starttime starts.

could you be please be bit explanatory (point 2 ) as am new to access .

-Sindhuja

CreganTur
01-30-2009, 10:55 AM
could you be please be bit explanatory (point 2 ) as am new to access .


In your code for Form 2 whenever you want to update the endtime on Form1: to work with an object on another open for you use this code format: Forms!FormName!ObjectName- where FormName is the form's name, and ObjectName is the name of the object you want to work with on Form1. So you could use:
Forms!FormName!ObjectName = Time()
just replace FormName with Form1's name, and ObjectName with the name of the textbox that will hold the EndTime. The above code will push the time to the textbox on Form1 from your code in Form2.

Form1 must be open at the same time as Form2 for the above code to work.