text box to update multi fields in table

  • Thread starter Thread starter deb
  • Start date Start date
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
 
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
 
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
 
Back
Top