Ensure Record selection from default setting (1 Viewer)

paulreed

Registered User.
Local time
Today, 21:59
Joined
Jan 30, 2003
Messages
42
I have a form which is used to display training courses, and which also contains a Combo box, from which one of 6 options can be chosen. The default option is 'Not Updated Yet', and the other options grade the success of the training.
Once the training course is finished we change the status of the record via a command button to 'expired', so that the record is retained for data analysis and reference purposes only.
Unfortunatly, often the form is updated to 'expired' without the Combo box being updated from 'Not Updated Yet' and which is undesirable.

Is there a way in which I can render the 'expired' command button inoperative UNTIL an option (other than the default value) has been selected from the combo box.
 

krunalprajapati

Registered User.
Local time
Tomorrow, 02:29
Joined
Dec 15, 2004
Messages
101
On combo box's click event write:
If combobox.value = 'yourdefaultvalue' Then
commandbutton.Enabled = False
Else
commandbutton.Enabled = True
End If
 

krunalprajapati

Registered User.
Local time
Tomorrow, 02:29
Joined
Dec 15, 2004
Messages
101
On combo box's click event write:
If combobox.value = 'yourdefaultvalue' Then
commandbutton.Enabled = False
Else
commandbutton.Enabled = True
End If
 

paulreed

Registered User.
Local time
Today, 21:59
Joined
Jan 30, 2003
Messages
42
I have tried this code but it still doesnt work!

Private Sub cmbox_AfterUpdate()
If cmbox.Value = "not updated yet" Then
btn.Visible = False
Else
btn.Visible = True
End If
End Sub

It is something to do with the "not updated yet", because if I change the criteria to a number rather than text (and also the format of the underlying table), it works. Any suggestions pls.

Private Sub cmbox_AfterUpdate()
If cmbox.Value = 3 Then
btn.Visible = False
Else
btn.Visible = True
End If
End Sub
 
R

Rich

Guest
Your code belongs in the Form Current Event, you should then Call it in the After Update event of your combo box.
Having said that the reason replacing the text with a number works is almost certainly because the textual value is not in the first column of your combo,
try
If cmbox.[Column](1) = "not updated yet" Then
btn.Visible = False
Else
btn.Visible = True
End If
End Sub


where column 1 is actually the second column in your combo
 

Users who are viewing this thread

Top Bottom