Conditionally Clear Contents

G

Guest

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)
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
=""
 
G

Guest

Ofer,

My hero, many thanks. Debbie D.

Ofer said:
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
=""
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Forms and Tables 2
Enhance Combo Box 1
Setting up tables for grades 17
combo box select 4
Requery Combo box in popup form 2
Requery Form from Combo Box 3
form filtering 3
Can't pull all the 2

Top