If "yes" then require data in another field

I have two fields on a form:  one a "check box"  and another a "combo list"

If the check box = Yes, then I want the field for the combo list to require 
data.  I can make it go the field that I want the date inserted, but I cannot 
seem to figure out how to make it mandatory for the user to insert data from 
the drop down list if the check box = yes. 
1
Utf
9/28/2007 8:01:01 PM
access 16762 articles. 3 followers. Follow

2 Replies
3000 Views

Similar Articles

[PageSpeed] 16

Use the Exit event of the ComboBox and
Cancel = True If Len(Me.ComboBox & "") = 0

Sheryl wrote:
>I have two fields on a form:  one a "check box"  and another a "combo list"
>
>If the check box = Yes, then I want the field for the combo list to require 
>data.  I can make it go the field that I want the date inserted, but I cannot 
>seem to figure out how to make it mandatory for the user to insert data from 
>the drop down list if the check box = yes.

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/200709/1

0
ruralguy
9/28/2007 8:46:44 PM
Private Sub Form_BeforeUpdate()
  If Me.Check1.Value = True And IsNull(Me.Combo1.Value) Then
    Cancel = True
    Me.Combo1 SetFocus
    Beep
  End If
End Sub

HTH

Pieter



"Sheryl" <Sheryl@discussions.microsoft.com> wrote in message 
news:B8804659-A894-41FC-8034-5A528B4CCAC6@microsoft.com...
>I tried this and it creates an error and tells me to debug.  Is there an 
>"if"
> statement that I could utilize?  Something to the effect - If [checkbox1] 
> =
> true then ComboBox1 Is Not Null
>
> I know that's not how to write it, but I'm just learning visual basic and 
> am
> not for sure how to write it.
>
> "ruralguy via AccessMonster.com" wrote:
>
>> Use the Exit event of the ComboBox and
>> Cancel = True If Len(Me.ComboBox & "") = 0
>>
>> Sheryl wrote:
>> >I have two fields on a form:  one a "check box"  and another a "combo 
>> >list"
>> >
>> >If the check box = Yes, then I want the field for the combo list to 
>> >require
>> >data.  I can make it go the field that I want the date inserted, but I 
>> >cannot
>> >seem to figure out how to make it mandatory for the user to insert data 
>> >from
>> >the drop down list if the check box = yes.
>>
>> -- 
>> HTH - RuralGuy (RG for short) acXP WinXP Pro
>> Please post back to this forum so all may benefit.
>>
>> Message posted via AccessMonster.com
>> http://www.accessmonster.com/Uwe/Forums.aspx/access/200709/1
>>
>> 


0
Pieter
9/29/2007 1:16:05 PM
Reply:

Similar Artilces:

Help replacing text with Yes or No
I have a field formated as general. The field contains either 1 or is left blank. If the field has a 1 I want to replace it with Yes and if the field is blank I want to replace it with No. any help is appreciated. -- Jerry Save your data and use a copy for this exercize........... Assuming your data in Column A, put this in B1 and copy down........ =IF(A1=1,"Yes","No") Then highlight the column and do Copy > PasteSpecial > Values to get rid of the formulas..........then delete column A if you wish....... Vaya con Dios, Chuck, CABGx3 "Jerry Arnone, ...

Outlook
Does anyone know how to change the default to Yes for Auto Archiving in Outlook 2003. I am wanting to do this globally for my whole organization with SMS. Is there a setting in RegEdit that could be changed? Carmen "Carmen" <anonymous@discussions.microsoft.com> wrote in message news:0eb801c49cff$3deb7090$a501280a@phx.gbl... > Does anyone know how to change the default to Yes for > Auto Archiving in Outlook 2003. I am wanting to do this > globally for my whole organization with SMS. Is there a > setting in RegEdit that could be changed? > > Carmen ...

Multiple yes/no boxes
I have a table that tracks steps completed in a project. The steps are setup as yes/no boxes. I am trying to write a querry the will bring back the current step in progress. For example, there are boxes for pursuit, purchase, construction, close, etc. When I run the report, I want only the last checked field to display. So if there are checks in pursuit, purchase and construction. I would like the report to display construction. Thank you ...

Macro & Yes/No Flip an Object?
Excel 2000 ... I have an "Object Arrow" that works similar to a hand on a clock. I am trying to move the arrow with recorded Macros, but depending upon where arrow is going to/from I find the need to sometimes "Flip" the Object ... Since the to/from is random ... I would like a little YES/NO Macro instruction to insert in my recorded code ... Macro would basically say ... If Object position OK ... Select YES ... Move on (skipping the "Flip" routine) If Object Position NOT OK ... Select NO ... Move on (activating the "Flip" routine). FYI ... ...

Yes/No Update through Select qry
I am thinking I am missing something very elementary, but regardless I'll ask. I have a form which when a user runs a query specific based upon their user id via a command button a list of tasks appear where the Completed field is 0 (ie not compelte) Is there a way that the user can change the value to -1 by simply checking the button on the same query? Currently it shows The recordset is not updateable. Thanks in advance I am releived it wasn't something completely obvious. I took your advice and am still a little confused (actually very confused) so I'll have to look d...

Delete key blocked asking yes/No remove this option
delete key bloked and function only wyhen i press Yes want to remove this bkockage Tools > options > general. Uncheck the two Words Perfect options. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org <>>< ><<> ><<> <>>< ><<> <>>< <>><<> "rana" <rana@discussions.microsoft.com> wrote in message ...

Need help with yes/no and tallys
I have a form that will beused by many users and I want the form t tally either yes or no check boxes or buttons. What would be the bes method to use that would give me a total talley at the bottom of th sheet? I have tried using various tools in the control toolbox and hav created some very nice check boxes or buttons, but alas I can not ge any of them to total up. Please help -- Steve ----------------------------------------------------------------------- Steve H's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2561 View this thread: http://www.excelforum.c...

How to ask whether a value is in a range of values, and produce a YES/NO answer
I know there is a way to do this, but I can't quite come up with it. I have a table in which I am trying to match one of the fields to anothter table (i.e., to check to see if it exists in that table). I need a yes or no result. To illustrate, I am in Sheet1 E2, and need to know if Sheet1 B2 existsin in the range Sheet 5 B9:B100. Thanks for any suggestions. Mike C <js2k111@yahoo.com> wrote in news:40dd464e-6b0f-47f1-af5f- 2df85f0bb964@q78g2000hsh.googlegroups.com: > I know there is a way to do this, but I can't quite come up with it. > > I have a table in which I a...

Yes/No data field help
Hello- I have several fields in Access that are Yes/No data types but I want them to be 0,1 in the TABLE and have a check box in the Form. How do I do this? When I choose the Yes/No Data Type in the table it defaults to the checkbox but I am guessing I can change this to text I still get yes and no when I do Combo box I can change the choices to 0,1 but I am unsure then how to change the combo box to a checkbox in the form. Thanks! If the datatype is YES/NO then you can just delete the combo box and then drag and drop a checkbox on to your form. Then, in the checkbox's record...

Several Yes or No
I need several time the same attribut, (Sold yes - no?) Is it possible to do it without creating multiples attributes to display the same information with the same name? On Oct 21, 7:45=A0am, Jo. P <J...@discussions.microsoft.com> wrote: > I need several time the same attribut, (Sold yes - no?) > Is it possible to do it without creating multiples attributes to display = the > same information with the same name? Jo. P It sounds like you have a one-to-many relationship here. (The same thing can be sold many times?) Therefore, I'd suspect you'd be better off creating...

Base combo box off of yes/no
Hello, I have a combo box that displays certain task for a company. Each task is primarily specific to a certain department, however, one department may be able to do the tasks of another. For instance a person in the office can do drafting and may make molds. While someone in the shop can make molds but would never do drafting. The way i was thinking about setting this up was have a table with a field that lists the task then in the fields next to it list my departments such as accounting, engineering, shop, etc with a yes or no box. so for instance, say i list Task = Mold Making,...

Hide object based on Yes/No field
Hi, I want to hide an object on a report if the value of the yes/no text box = no or 0 I keep getting an error "you entered an expression that has no value" What am I doing wrong? Here is my code from reports event Open: If Me.txtcheckbox = "0" Then Me.objectOne.Visible = False End If It's 0 (or False), not "0" Even simpler would be: Me.objectOne.Visible = Me.txtcheckbox -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "adna" <adna@discussions.microsoft.com> wrote in message news:E0817F5C-2A8E-...

Yes/No control box
Hi Folks, How can I have a control "Yes/No" on a form that once the checkbox is checked that do not show the line record on my report Thanking you in advance for your answer Fredderic Fredrick, Create a field in your table called something like NoPrint, and make it a Yes/No (True/False). Place that field on your form. If the field is checked (True), then that record will be excluded from your report. In the query behind your report, use a criteria against the NoPrint field... = False That says... show me only records where NoPrint is False. -- hth ...

How do I show a checkbox in a cell holding a true/false or yes/no or 1/0 value?
I'm sure I've seen this in Excel spreadsheets before, but can't find an example anywhere and I'm getting frustrated with the help system's insistence on showing the answers to completely irrelvant questions I just didn't ask. I want the spreadsheet user to be able to check or uncheck a box to signify a yes/no value. Should be simple right? Somebody help me out, please. Brian Lowe ---------@ You could try drawing check boxes from the Forms Toolbar, via View > Toolbars > Forms (not from the Control Toolbox) See : http://tinyurl.com/vykc for a previous outline...

BIG BEEF !!! Yes I'm Shouting ...
For crying out loud, why does Microsoft love to shoot themselves in the foot! We want to use Outlook to consolidate all our e-mail, but then they pull tricks like NOT allowing us to connect to certain Hotmail accounts or by limiting our Hotmail attachment downloads to ONE minute? Furthermore, we waste hours (sometimes days) trying to decipher some vague error message in order to figure out why we cannot connect or stay connected, only to find out that it is by Microsoft design! Golly sakes, if you cripple the program, have the decency to display a message that says so when you disco...

Yes/No export appearance
Access 2007 question and probably a simple one at that. I work with a database that I export to excel on a daily basis. We use a number of "Yes/No" check boxes on our main table. When I export this table, these checkbox fields appear as "True" or "False." Is there a way to change this so when it exports it shows as "Yes" or "No" ? FYI: In the fields' properties, under general, it says "Yes/No" instead of "True/False" or "Off/On." Thanks, A Use a calculated field in place of the real field in the query that...

How to: Automaticly choose "YES"
One of the macro's I use makes a sheet, uses it and then deletes it. Because there is a sheet which is deleted, Excel asks confirmation while the Macro is running. I'd rather see that it was solved without the user has to click yes. My question: "How can I get Excel to not ask me the "Are you Sure?" question again?" Jasper Application.DisplayAlerts = False Sheets("Sheet3").Delete Application.DisplayAlerts = True Regrads Trevor "Jasper" <Jasper@discussions.microsoft.com> wrote in message news:872F0D5B-E9B2-4069-B474-27D6329E17BE@...

counting a yes/no field
I'm using Access 2002. In the grouping footer I am trying to write a formula to count the number of "Yes" of yes/no field. The result I receive is counting the amount of items in the group. date excused 12/3/2007 yes 12/102007 yes 12/20/2007 no formula =count([excused]=yes) Returns 3 not 2 formula =count([excused]=true) Returns 3 not 2 Can anyone help? Thanks. Susan Susan You are counting the number of [excused]. If you Sum([excused]), you'll get a number that represent how may are "true". If your dat...

YES or NO formulas
Hi, I have a column that has a series of numbers it will always be either 10000 or 10100 , I want it to return a No for 10000 or Yes for 10100 in the field next to it, I have tried and I can't seem to make it work, I can do one or the other, any assistance would be greatly appreciated. The cells I am using for example are BF20 to BF34 and the answer I want to go into BG20 to BG34 Thanks!!!! BG20: =IF(BF20=10000,"No","Yes") and copy down -- HTH Bob "Alyssa" <Alyssa@discussions.microsoft.com> wrote in message news...

Yes or No question on dirty
I would like to have a message pop up when data is changed in a form with the action to follow. I know it has something to do with the property of "On dirty" If any control is changed in the "Employee" form is made, I should receive a message stating " You have updated information on this record. Do you want to save it?" The answer of "Yes" or "No" is selected and the action should happen with an exiting statment of "Update has been saved" or "update has not been saved" Use the form Before Update event: If Msgb...

yes, virus!
My desktop icons are changing arbitrarily. IE is now the classic "e" but the infill is the MS OL icon. it may not be a virus - that happens when the icon cache is corrupt. Have you rebooted recently? Did you open any of the attachments you received by email? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Subscr...

I can't get a checkbox to work with a yes/no field.
I am having some problems with a check box. I've added a field named "Floor" , which is a yes/no field. tWhen I create the ehckbox I realize I must bind it to a control source, which I do to the field named Orders!Floor. However, when I click the checkbox on the form, I get the error message "Control can't be edited. It's bound to the expression Orders!Floor." I've tried unbinding the checkbox, and then using visual basic "on click" event for that checkbox to read the value of the field, and then toggle the display of the checkbox. But, t...

No to HTML mails and yes to show sending address ...
I just started using Outlook 2003 after using Outlook Express for a lon time. I must say that Outlook is great once you get to know it. I spent a lot of time configuring it for my needs and only have tw questions left - two things I loved OE for. :) - Is it possible, when replying to a HTML mail, to automatic reply i normal text? That is that it converts the HTML mail to text and that don't have to do this manually by choosing "text" in the menubar. - When writing a mail in OE there is a field when one always can se the address the mail is sent by. Is it possible to have th...

Novice - MsgBox Yes/No
I have a form to be completed by staff ONLY if they have approval to proceed with the work. I've managed (with this group's assistance!) to have a message box pop up but I want to add a wrinkle where if they press "yes", they can proceed to fill in the form, if they press "no", the file closes. I've never done If/Then in VBA (this is actually my first foray into VBA). Help please!: Sub Auto_open() MsgBox "The Project Manager's or Project Administrator's approval must be obtained prior to proceeding with this work. Has approval been obtain...

Displaying Yes/No as Yes or No instead of -1 and 0 01-21-10
Hi, I know that I've done this before, but now I can't remember how I did it... In my form, I want my Yes/No combo box to display Yes or No instead of -1 or 0 after the choice is made. I'm remembering something about column widths, but so far no luck. Thanks for your help! on the Porperty Sheet you can set Format to Yes/No laura.dodge wrote: >Hi, I know that I've done this before, but now I can't remember how I >did it... > >In my form, I want my Yes/No combo box to display Yes or No instead of >-1 or 0 after the choice is made. I'm rem...