Help with refreshing a form with Yes/No box

Caliban1971

New member
Local time
Today, 07:12
Joined
May 10, 2011
Messages
4
Hi.

I have a yes/no check box on a split form called "Bilingual", and when it is Yes, another control, "LanguagesSpoken" becomes enabled - which is a multivalued list of languages to choose from. My code looks like this:

Private Sub Bilingual_Click()
If Bilingual = True Then
LanguagesSpoken.Enabled = True
Else
LanguagesSpoken.Enabled = False
End If
End Sub

This works well enough, but when I move to another record or create a new record, the controls do not refresh. In other words, I want the next record to act independently, and if I create a new record, I want the "LanguagesSpoken" control unenabled until I check the "Bilingual" box. I hope this makes sense. I am using Access 2007. Thank you!
 
For it to persist from record to record you must also place the code in the Form_Current event, as well as in the AfterUpdate event.

Linq ;0)>
 
Very good! That seems to do the trick. Thanks for the help, and for replying so quickly, I really appreciate it.
 
Thank you. I have been building rudimentary DB's for myself and at work, and have struggled sometimes to find answers in books and online, and finally realized that joining here might be a good idea. Doing VBA is daunting to me, so may I ask where you think I might go to get a good primer here online?
 
Here's some sites, listed from the easiest to understand to the more difficult, that go into the nuts and bolts of development, after you get a handle of table design.

Chrystal has an excellent “basics” tutorial:

http://www.accessmvp.com/strive4peace

This is a little more advanced, but still a great starting point, having 23 well written, well defined, clearly named chapters.
:
http://www.functionx.com/vbaccess/index.htm

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

MVP Allen Browne's extensive list of tutorials and on-line reference materials:
http://allenbrowne.com/links.html#Tutorials

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom