472,114 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,114 software developers and data experts.

Option Groups and updating form

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
6 2282
12,516 Expert Mod 8TB
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
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
12,516 Expert Mod 8TB
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
sorry didn't mean to double post
Aug 9 '07 #5
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
12,516 Expert Mod 8TB
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.

Similar topics

10 posts views Thread by David | last post: by
4 posts views Thread by Y Plas | last post: by
20 posts views Thread by PC Datasheet | last post: by
1 post views Thread by Stephen D Cook | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.