Problem with code for form

HockeyNut

Tureco Del Hockey
Local time
Today, 11:00
Joined
Feb 25, 2003
Messages
62
This is the code I have an issue with.
Code:
Private Sub cboClientType_AfterUpdate()
    Me.cboClientType.SetFocus
    Me.txtEstablishmentName.Enabled = (Me.cboClientType.Text = "Establishment")
    Me.txtBirthdate.Enabled = (Me.cboClientType.Text = "Individual")
    Me.txtDeceased.Enabled = (Me.cboClientType.Text = "Individual")
End Sub

Btw, is that the right HTML Tag to use to get my code to appear correctly? [ CODE ] ?

Anyway, back to my problem.
The code works, in so much as it enables/disables the appropriate fields on the form, depending on the selection of the cboClientType combo. However, if I then flick onto the next record, the same fields (from the previous record) are disabled/enabled regardless of what is selected in the cboClientType. I assume this is because the code is attached to the "cboClientType_AfterUpdate" event.
Can anyone give me any advise as to the best way to resolve this problem?

Kind regards,

HN.
 
in form current event put

call cboClientType_AfterUpdate

That should do it

Steve
 
Thanks indesisiv,

That sounds good, I'll try that.

Is FormCurrent an event which fires when each new record loads, rather than the initail FormLoad, (which would obviously be too early and not work).

EDIT: Just tried it, works a treat! :)
 
Last edited:

Users who are viewing this thread

Back
Top Bottom