473,385 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Make a text box entry mandatory dependant on Option Group Selection

I am creating a rather unwieldy database (MS Access 2000) in which the client wants to provide the users with an "Other" option for every option group. The client also wishes the user to explain what "Other" is. How do I make sure that the client enters the explanation?

I have tried the following in AfterUpdate, On LostFocus, and On Exit. But nothing works. I have never tried to code events on option groups and am finding it very difficult. Any assistance will be appreciated.

Thanks!

Expand|Select|Wrap|Line Numbers
  1.  
  2. If [OptionGroup] = 4 And [txtbox] = Null Then
  3.    MsgBox "Please provide explanation for 'Other'. "
  4. End If
  5.  
  6.  
Sep 26 '07 #1
2 2264
Scott Price
1,384 Expert 1GB
Have you made sure that the Option Group frame is named and spelled correctly in your code?

Generally speaking, also, you would want to designate which form it resides on:

Me!...
Forms![FormName]

Are two ways. The first is when the code resides in the form module that is executing the code. The second when it resides in another module.

Regards,
Scott
Oct 5 '07 #2
missinglinq
3,532 Expert 2GB
Where the name of the option frame is OptionGroup (and is bound to a numerical field in the underlying table) and the text box is named OtherExplanation
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel As Integer)
  2.  
  3.  If Me.OptionGroup = 4 And IsNull(Me.OtherExplanation) Then
  4.     MsgBox "Please explain 'Other'. "
  5.     Cancel = True
  6.     Me.OtherExplanation.SetFocus
  7.  
  8.   End If
  9. End Sub 
Linq ;0)>
Oct 5 '07 #3

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

Similar topics

6
by: Frans Englich | last post by:
Hello, In my use of getopt.getopt, I would like to make a certain parameter mandatory. I know how to specify such that a parameter must have a value if it's specified, but I also want to make...
0
by: Rob | last post by:
Hello, I am having an application using A2K.In my subform ,I have 3 combos.Division,Group and Names.The Names are dependant on Division and Group.But in some cases there are Names without...
2
by: David | last post by:
Does anybody know how to check the AllowSelection radio button in the PrintDialog Dialog? I want to set this to checked if the user has selected a subset of text.
3
by: excel_hari | last post by:
Hi, I couldnt locate a Classic ASP group hence posting here. One of my colleagues has designed an intranet site and one of the pages has a drop-down box with close to 300 options. I want to...
3
by: Stefan Mueller | last post by:
I've an input box <input type = "text" name = "MyInput" value = ""> and a selection <select name = "MySelection" size = "1"> <option value = "1">Entry 1 <option value = "2">Entry 2 </select>...
2
by: Sethos | last post by:
I am sure that this has been covered, hashed, and rehashed, but a search on the group did not produce the answer, so forgive me if this seems like a "newbie" type question... Besically, I have a...
4
by: devine | last post by:
Hi All, I am VERY new to Javascript. I have been provided with some code, which will enable me to hide/show a text area and change a submit button dependant on a check box. <!DOCTYPE html...
1
by: mlshoats | last post by:
Hello I am trying to make a log to track questions i answer on little hardware problems. I got most of it working but I am very new to programming anything and just started picking up things. I am...
18
by: Academia | last post by:
I let the use modify the text of a combobox and then I replace the selected item with the new text (in Keyup event). But if he sets the Text property to an empty string ("") that sets the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.