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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditionally Clear Contents



 
 
Thread Tools Display Modes
  #1  
Old September 24th, 2005, 07:36 PM
Debbie D.
external usenet poster
 
Posts: n/a
Default Conditionally Clear Contents

Hi all,

I have a combo box on a form. The como box selects a studentID. After
selecting a student the user can then select from a second combo box their
tutor. The form itself is for students to select a test. If the student
wishes to cancel their 'appointment' with a tutor their is a special ID
available in the first combo box, studentID '0'. This returns the text in
the combox box to 'Available'. The student then has to manually clear the
second combo box with the tutors name. Is it possbile to automatically clear
the second combo with the first one states, studentID '0'. I was thinking
along the lines of:

iif(combo1=0, combo2.value="".......)

Any ideas where I would put should code? Onupdate? Many thanks for taking
the time to read this. Any and all help very welcome.

Debbie D. (UK)
  #2  
Old September 24th, 2005, 09:15 PM
Ofer
external usenet poster
 
Posts: n/a
Default

Hi Debbie, On the after update event of the student you can write the code

If Me.combo1=0 then
me.combo2=Null
End If

--
I hope that helped
Good luck


"Debbie D." wrote:

Hi all,

I have a combo box on a form. The como box selects a studentID. After
selecting a student the user can then select from a second combo box their
tutor. The form itself is for students to select a test. If the student
wishes to cancel their 'appointment' with a tutor their is a special ID
available in the first combo box, studentID '0'. This returns the text in
the combox box to 'Available'. The student then has to manually clear the
second combo box with the tutors name. Is it possbile to automatically clear
the second combo with the first one states, studentID '0'. I was thinking
along the lines of:

iif(combo1=0, combo2.value="".......)

Any ideas where I would put should code? Onupdate? Many thanks for taking
the time to read this. Any and all help very welcome.

Debbie D. (UK)

  #3  
Old September 24th, 2005, 10:33 PM
Debbie D.
external usenet poster
 
Posts: n/a
Default

Ofer,

Good to recieve you very welcome advise once again this week. It worked
great but then I tried it on another combo box in the subform. The only
thing different is that this combo contents are coming from a query behind
the subform. Here is my code, well to be honest its yours ;-) As you can see
tried the column(0) to see if this makes a difference.

Private Sub CustID_AfterUpdate()
If Me.CustID.Column(0) = 0 Then
Me.Note = Null
Me.Module = Null
End If


End Sub

But I get this message ' Runtime error 94' Invalid use of Null

"Ofer" wrote:

Hi Debbie, On the after update event of the student you can write the code

If Me.combo1=0 then
me.combo2=Null
End If

--
I hope that helped
Good luck


"Debbie D." wrote:

Hi all,

I have a combo box on a form. The como box selects a studentID. After
selecting a student the user can then select from a second combo box their
tutor. The form itself is for students to select a test. If the student
wishes to cancel their 'appointment' with a tutor their is a special ID
available in the first combo box, studentID '0'. This returns the text in
the combox box to 'Available'. The student then has to manually clear the
second combo box with the tutors name. Is it possbile to automatically clear
the second combo with the first one states, studentID '0'. I was thinking
along the lines of:

iif(combo1=0, combo2.value="".......)

Any ideas where I would put should code? Onupdate? Many thanks for taking
the time to read this. Any and all help very welcome.

Debbie D. (UK)

  #4  
Old September 24th, 2005, 10:52 PM
Ofer
external usenet poster
 
Posts: n/a
Default

If it gives you invalid use of null, so most chance that the type of the
fiels is text, in that case try and change it form
=Null

To
=""
--
I hope that helped
Good luck


"Debbie D." wrote:

Ofer,

Good to recieve you very welcome advise once again this week. It worked
great but then I tried it on another combo box in the subform. The only
thing different is that this combo contents are coming from a query behind
the subform. Here is my code, well to be honest its yours ;-) As you can see
tried the column(0) to see if this makes a difference.

Private Sub CustID_AfterUpdate()
If Me.CustID.Column(0) = 0 Then
Me.Note = Null
Me.Module = Null
End If


End Sub

But I get this message ' Runtime error 94' Invalid use of Null

"Ofer" wrote:

Hi Debbie, On the after update event of the student you can write the code

If Me.combo1=0 then
me.combo2=Null
End If

--
I hope that helped
Good luck


"Debbie D." wrote:

Hi all,

I have a combo box on a form. The como box selects a studentID. After
selecting a student the user can then select from a second combo box their
tutor. The form itself is for students to select a test. If the student
wishes to cancel their 'appointment' with a tutor their is a special ID
available in the first combo box, studentID '0'. This returns the text in
the combox box to 'Available'. The student then has to manually clear the
second combo box with the tutors name. Is it possbile to automatically clear
the second combo with the first one states, studentID '0'. I was thinking
along the lines of:

iif(combo1=0, combo2.value="".......)

Any ideas where I would put should code? Onupdate? Many thanks for taking
the time to read this. Any and all help very welcome.

Debbie D. (UK)

  #5  
Old September 24th, 2005, 11:53 PM
Debbie D.
external usenet poster
 
Posts: n/a
Default

Ofer,

My hero, many thanks. Debbie D.

"Ofer" wrote:

If it gives you invalid use of null, so most chance that the type of the
fiels is text, in that case try and change it form
=Null

To
=""
--
I hope that helped
Good luck


"Debbie D." wrote:

Ofer,

Good to recieve you very welcome advise once again this week. It worked
great but then I tried it on another combo box in the subform. The only
thing different is that this combo contents are coming from a query behind
the subform. Here is my code, well to be honest its yours ;-) As you can see
tried the column(0) to see if this makes a difference.

Private Sub CustID_AfterUpdate()
If Me.CustID.Column(0) = 0 Then
Me.Note = Null
Me.Module = Null
End If


End Sub

But I get this message ' Runtime error 94' Invalid use of Null

"Ofer" wrote:

Hi Debbie, On the after update event of the student you can write the code

If Me.combo1=0 then
me.combo2=Null
End If

--
I hope that helped
Good luck


"Debbie D." wrote:

Hi all,

I have a combo box on a form. The como box selects a studentID. After
selecting a student the user can then select from a second combo box their
tutor. The form itself is for students to select a test. If the student
wishes to cancel their 'appointment' with a tutor their is a special ID
available in the first combo box, studentID '0'. This returns the text in
the combox box to 'Available'. The student then has to manually clear the
second combo box with the tutors name. Is it possbile to automatically clear
the second combo with the first one states, studentID '0'. I was thinking
along the lines of:

iif(combo1=0, combo2.value="".......)

Any ideas where I would put should code? Onupdate? Many thanks for taking
the time to read this. Any and all help very welcome.

Debbie D. (UK)

 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Macro to clear out check box seletions Mel Worksheet Functions 5 May 20th, 2005 08:35 PM
Clear Contents But Not Formula Gancom3 General Discussion 2 February 1st, 2005 11:30 PM
Item in Table of Contents throw off numbering Robert McN Page Layout 4 January 27th, 2005 12:50 AM
Clearing the contents of unbound cells Belle General Discussion 3 January 20th, 2005 03:03 PM
Text (not headings) that needs to appear in TOC Linda Formatting Long Documents 2 June 4th, 2004 08:03 PM


All times are GMT +1. The time now is 03:53 AM.


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