Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 12th, 2006, 06:17 PM
Authorized User
 
Join Date: Sep 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Event on record change

Hi all,
i am still new to access and VBA, so i might have missed the simplest thing... anyway

i am looking to have an event take place when the next or previous record is selected

i would like to do this without creating my own navigation buttons.

thought maybe a On DoCmd.GoToRecord , , acNext then do something

any help would be much appreciated

cheers

 
Old October 13th, 2006, 02:27 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What exactly are you trying to do with the code? What events will trigger the code? Are you using a form, report or table? Etc.


mmcdonal
 
Old October 15th, 2006, 10:02 PM
Authorized User
 
Join Date: Sep 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a form that has option buttons on it, the options are Quote, Order, Site Visit and Dead Lead. i have a hidden field called Conversion which equals in text the option that is checked eg. Quote option is checked, conversion = "Quote". (This is all done by Code) The problem is when i select say the prvious record that had Order selected, Quote is now checked, though conversion field still says "Order"... So what i am trying to do is have an event when the previous record is selected Conversion field is checked and the relative option button is changed to match..

i hope this makes sence

 
Old October 18th, 2006, 07:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

You want to check the value of your field and change the availability of buttons using the ON CURRENT event.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old October 18th, 2006, 07:39 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Is this an option group? If so, these are radio buttons.

I would suggest putting a field in your table tied to the option group so that the option group can read the number of the option selected when you scroll to that record, and if you need some text, then you can do the conversion yourself based on the number value in the option field.

This way the option group will automatically read its proper value, and you won't have to code and recode for the text value.

mmcdonal
 
Old October 18th, 2006, 07:13 PM
Authorized User
 
Join Date: Sep 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for all your help,
The ON CURRENT event seems to be working fine.

thanks again






Similar Threads
Thread Thread Starter Forum Replies Last Post
Change of event using 2 combobox yogeshyl Excel VBA 0 July 31st, 2007 05:02 AM
Form change record event ?? Stanny Access 1 December 21st, 2004 12:21 PM
Change Event Help BryanBrassell Excel VBA 4 July 29th, 2004 03:42 PM
Change Event BryanBrassell Excel VBA 0 December 18th, 2003 01:27 PM
Help with Worksheet Change Event BryanBrassell Excel VBA 1 June 24th, 2003 09:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.