Go to next record

atisz

Registered User.
Local time
Today, 10:42
Joined
Apr 5, 2005
Messages
96
Hi,

I have made a database about 4 years ago, since then it's used with success, and I've made some changes from time to time to improve it continuously. Now I would like to implement a solution to improve the data input process.
What it's all about...
I have a form called frmCustomers, which is the main form, and another form called frmMonthlyServices, which is placed as a subform on frmCustomers. The link field between this two is CustomerID.
The provided services are monthly services, so data is entered once/each month for all customers. To take the new value (value=quantity of service) of a month as old value for the next month, on frmMonthlyServices on the On click event of Add new record button is placed the following code:

Const cQuote = """"
Me!Old_value.DefaultValue = cQuote & Me!New_value.Value & cQuote
DoCmd.GoToRecord , , acNewRec
Me.New_value.SetFocus

As the things are working currently, after entering the new value, the user has to go down to the navigation buttons of form frmCustomers to go to the next record (next customer), after that has to click on Add new record button of the subform (frmMonthlyServices), and so on. This way, when hundreds of customer has to be handled, things doesn't look very good, the data input process goes with loss of precious time.
That's why I would like to change the code above, to allow going to next customer when the Add new record button is clicked on the subform.
Basicly my question is: how can I go to the next record on my main form, when a button is clicked on the subform?

Any help is more then wellcome.
Thanks, Attila
 
If I recall...I think you can sneak this off by forcing a Requery of Refresh of the Main (parent) Form.

In the OnCurrent Event of the SubForm:

Forms("MainFormName").Requery

or

Forms("MainFormName").Refresh

.
 
??????

If I recall...I think you can sneak this off by forcing a Requery of Refresh of the Main (parent) Form.

In the OnCurrent Event of the SubForm:

Forms("MainFormName").Requery

or

Forms("MainFormName").Refresh

.

Hm.... I don't know if a Refresh or Requery will help me. As i Know the refresh has as result the refresh of data, the requery is doing almost the same thing but he will bring me to the first record. What I need is to go to next record.
 
Without a sample to to play with and see how things are set up, I'm afraid it may be one of those "poke n play" things until it works out (shudder).

If you can provide a Sample DB atisz demonstrating the same issues, it would make things a lot easier to sort out.

.
 

Users who are viewing this thread

Back
Top Bottom