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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |