The Brown Growler
Registered User.
- Local time
- Today, 23:15
- Joined
- May 24, 2008
- Messages
- 85
Hi,
Would anyone please be able to assist me with some VBA code to be used in an access database ?
I have an access table containing the horse name, the race track, the date and the official rating that the horse performed to on that date. I hope to be able to compare the rating achieved on any date with the rating achieved on the previous data when the race tracks are the same. If the rating increased by comparison to the previous value then a calculated field should be "+R" if the rating decreased then the value should be"-R" and if no change, "R". If there are no occasions of the horse running at the track previously then the value should be "R"
I have pasted below an example that illustrates the principle:
Horse Racecourse Date Rating Rating Change
Iruntoomuch Wolverhampton 26/09/2009 67 -R
Iruntoomuch Wolverhampton 25/09/2009 68 +R
Iruntoomuch Wolverhampton 24/09/2009 65 +R
Iruntoomuch Lingfield....... 23/09/2009 66 R
Iruntoomuch Lingfield....... 22/09/2009 66 +R
Iruntoomuch Lingfield....... 21/09/2009 65 R
Iruntoomuch Wolverhampton 20/09/2009 64 +R
Iruntoomuch Wolverhampton 19/09/2009 63 +R
Iruntoomuch Wolverhampton 18/09/2009 62 R
I hope to be able to run the code by clicking a button on a form that either directly runs the code from the button "onclick" property or runs a module containing the code.
Any help most appreciated.
Thx & Rgds
Growlos
Would anyone please be able to assist me with some VBA code to be used in an access database ?
I have an access table containing the horse name, the race track, the date and the official rating that the horse performed to on that date. I hope to be able to compare the rating achieved on any date with the rating achieved on the previous data when the race tracks are the same. If the rating increased by comparison to the previous value then a calculated field should be "+R" if the rating decreased then the value should be"-R" and if no change, "R". If there are no occasions of the horse running at the track previously then the value should be "R"
I have pasted below an example that illustrates the principle:
Horse Racecourse Date Rating Rating Change
Iruntoomuch Wolverhampton 26/09/2009 67 -R
Iruntoomuch Wolverhampton 25/09/2009 68 +R
Iruntoomuch Wolverhampton 24/09/2009 65 +R
Iruntoomuch Lingfield....... 23/09/2009 66 R
Iruntoomuch Lingfield....... 22/09/2009 66 +R
Iruntoomuch Lingfield....... 21/09/2009 65 R
Iruntoomuch Wolverhampton 20/09/2009 64 +R
Iruntoomuch Wolverhampton 19/09/2009 63 +R
Iruntoomuch Wolverhampton 18/09/2009 62 R
I hope to be able to run the code by clicking a button on a form that either directly runs the code from the button "onclick" property or runs a module containing the code.
Any help most appreciated.
Thx & Rgds
Growlos