A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Field required only if check box selected



 
 
Thread Tools Display Modes
  #1  
Old July 15th, 2009, 09:05 PM posted to microsoft.public.access.gettingstarted
Breezy
external usenet poster
 
Posts: 38
Default Field required only if check box selected

I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.
  #2  
Old July 15th, 2009, 11:31 PM posted to microsoft.public.access.gettingstarted
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default Field required only if check box selected

Put in the checkbox OnChange Event. Something like:

If isNull(me.whatever) then
msbox "this value is required"
me.whatever.setfocus
end if

Bonnie
http://www.dataplus-svc.com

Breezy wrote:
I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/200907/1

  #3  
Old July 16th, 2009, 02:34 PM posted to microsoft.public.access.gettingstarted
Breezy
external usenet poster
 
Posts: 38
Default Field required only if check box selected

Thanks!!

"bhicks11 via AccessMonster.com" wrote:

Put in the checkbox OnChange Event. Something like:

If isNull(me.whatever) then
msbox "this value is required"
me.whatever.setfocus
end if

Bonnie
http://www.dataplus-svc.com

Breezy wrote:
I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/200907/1


  #4  
Old July 17th, 2009, 05:19 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Field required only if check box selected

On Wed, 15 Jul 2009 13:05:02 -0700, Breezy
wrote:

I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.


Since the two controls could be filled out in either order, your best bet is
to put the check in the Form's (not either control's) BeforeUpdate event: e.g.

Private Sub Form_BeforeUpdate(Cancel as Either)
If Me!chkComplete = True AND If Me!txtRONumber & "" = "" Then
Cancel = True
MsgBox "Please fill in the RO#", vbOKOnly
End If
End Sub

--

John W. Vinson [MVP]
  #5  
Old July 17th, 2009, 06:20 PM posted to microsoft.public.access.gettingstarted
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default Field required only if check box selected

I understood him to say that he wanted to check if RO# was filled out when
the COMPLETE box.

Bonnie
http://www.dataplus-svc.com

John W. Vinson wrote:
I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.


Since the two controls could be filled out in either order, your best bet is
to put the check in the Form's (not either control's) BeforeUpdate event: e.g.

Private Sub Form_BeforeUpdate(Cancel as Either)
If Me!chkComplete = True AND If Me!txtRONumber & "" = "" Then
Cancel = True
MsgBox "Please fill in the RO#", vbOKOnly
End If
End Sub


--
Message posted via http://www.accessmonster.com

  #6  
Old July 18th, 2009, 03:58 AM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Field required only if check box selected

On Fri, 17 Jul 2009 17:20:59 GMT, "bhicks11 via AccessMonster.com"
u44327@uwe wrote:

I understood him to say that he wanted to check if RO# was filled out when
the COMPLETE box.


That's exactly what I understood as well. I called the COMPLETE box
chkComplete - the OP should use whatever the name of the control might be.

Bonnie
http://www.dataplus-svc.com

John W. Vinson wrote:
I need to make one field required on my form only if the user checks the box
as complete. I would like to have something pop up and ask for the RO# that
they used to complete the work. I have the field on the form but do not know
how to make it required after selecting complete.


Since the two controls could be filled out in either order, your best bet is
to put the check in the Form's (not either control's) BeforeUpdate event: e.g.

Private Sub Form_BeforeUpdate(Cancel as Either)
If Me!chkComplete = True AND If Me!txtRONumber & "" = "" Then
Cancel = True
MsgBox "Please fill in the RO#", vbOKOnly
End If
End Sub

--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.