By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Option Groups and updating form

P: 71
I've got an option group with 5 options, with no default value. Whenever I open the form and scroll through records all of the options are grey'd, unless the user selects one.

What I would like to do is have the option group display the current value of the options, depending on the record being viewed. So that as you scroll through records whatever option is currently selected (based on the table) for that record is already selected in the option group.

I've got an if statement setup that *should* handle this, but I'm not sure where to place the code. I've tried to use form_activate() and form_AfterUpdate(), but niether seems to work. Can anyone help me with where I should put code like this?
Aug 9 '07 #1
Share this Question
Share on Google+
6 Replies


Rabbit
Expert Mod 10K+
P: 12,349
Set the control source of the option group to the field in the table and you won't need any code.
Aug 9 '07 #2

P: 71
The problem I have there is the way the option group works.

The field that the option group refers to has to be a text field, but option groups can only return numbers. So I have the option group unbound, and then have an invisible textbox that stores a specified string based on the number returned from the option group.
Aug 9 '07 #3

Rabbit
Expert Mod 10K+
P: 12,349
What about having a look up table instead and storing the number rather than the text? It'll save you space in the long run with the benefit of making your form simpler. No need for code and you can get rid of that hidden text box.
Aug 9 '07 #4

P: 71
sorry didn't mean to double post
Aug 9 '07 #5

P: 71
The way things are set up right now, I've got an option group with 5 options, representing folders where a file is stored. The database is then linked to a webpage, and that field is used along with the name of the file to create a hyperlink to the file.

One of the options I have is an "other" option, that has a textbox next to it that allows the user to input in a specified folder. That was in the future if we add a new folder to store files in, the form would still work.
Aug 9 '07 #6

Rabbit
Expert Mod 10K+
P: 12,349
Well, the design difficulties aside.

If your if code works, then you'll need to put it in the after update event of the option group and the on current event of the form.
Aug 9 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.