text box to update multi fields in table

D

deb

I have a form with a text box that updates the "Status" field in the table
"tCritical"
The user is to input either R,G or Y.

When the user inputs the R,G or Y I would like the "Phase" field to be
updated automatically with the word Entry and the "Area" field to be updated
with the word "Sales" (in the tCritical table).

How can this be done?

Thanks
 
D

Dennis

Assuming your form is bound to the tCritical table and the Phase and Area
fields are on the form, then in the after update event of the Status field put

IF Status="R" Or Status="G" Or Status="Y" Then
Phase = "Entry"
Area = "Sales"
End If
 
K

Klatuu

Create bound controls for Phase and Area on your form. You can hide them by
setting their Visible properties to No.
In the After Update event of the Status text box, set their values. You
don't say what the values should be if one of the 3 status codes is not
entered, so the example below sets them to Null.

Private Sub txtStatus_AfterUpdate()

With Me
If Instr("RGY", .txtStatus) = 0 Then
.txtPhase = Null
.txtArea = Null
Else
.txtPhase = "Entry"
.txtArea = "Sales"
End If
End With
End Sub
 

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

Top