Capture return to form event

BLS

New member
Local time
Today, 05:48
Joined
Nov 24, 2016
Messages
7
Access 2010. Popup Modal Form A records data to tblMatches has combi Boxes. An update of a combi causes a couple of routines to run which add part of their of details to two textboxes. This All works well.

If there is a change to details, double click on the combi opens popup Form B to edit that persons data. The data is saved to tblPlayers.

On closure of Form B I cannot find a way to rerun the sub routines automatically.
The routines run on exit of the combi but it seems a bit untidy

Requery the combi or form , gotfocus does not fire the routines.
 
If A is still open when B is being closed you can run the subroutines in A from the closing procedure in B if you change the subroutines in A to Public. You could run it with
Code:
Forms!TheNameOfYourForm.TheNameOfTheSubroutine
or
Code:
Form_TheNameOfYourForm.TheNameOfTheSubroutine

Somehow this doesn't seem very tidy either. Why is this necessary? Could you tell us more about this or upload your database.
 
Last edited:
Steve
Its for organising inter club golf matches.
Form A has combi boxes for up to 20 players on each side.
Each event is a single record in the Matches table so its mainly numbers referring to other tables.
The drop down for the combi will display Player name and handicap plus hidden columns. Only the players name is displayed in the combi field
On update of the combi this updates the textbox with the players handicap which in turn checks the handicaps of the four players in that assoicated group and calculates the shots allowed for different golf formats and adds that to another textbox.

Should the handicap be wrong initially and is changed I need to fire the routines again.

Thank you Steve for the suggestion.
I will work on that as I will have to work through that. I will have to loop through the fields and call the various routines.. Going out now so it won't be for some time..
Bruce
 
If there are multiple players in a single record I think should consider revising your structure. If a database is not in normal form things can get really untidy. If you are not familiar with normal forms I suggest you check out this explanation.
 
Steve
Just got back and had a play.
Good news:)

Am aware of normalisation. Think I had mine correct (Touch Wood) as the data held in tblMatches is mainly primary numbers from 14 other tables and will only be relevant to that particular event in that mixture.

Revisited the Players form. Looked at your suggestions and decided to add extra code to the function which is called by the spin button of the handicap.
That now loops through the frmTeams players combi fields searching for the PlayerID that's been adjusted. Finding it identifies the combi which gives me the handicap text box which it updates.
Having Identified the handicap box I can now call the Public Function to recalculate the shots for the group that player is in.

It works instantly So thanks for nudging me in the right direction.
Mind you walking away for a Sunday dinner and a couple of beers may have help as well....

Thanks Again

Bruce
 

Users who are viewing this thread

Back
Top Bottom