A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

text box to update multi fields in table



 
 
Thread Tools Display Modes
  #1  
Old June 18th, 2008, 03:36 PM posted to microsoft.public.access.forms
deb
external usenet poster
 
Posts: 898
Default text box to update multi fields in table


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
--
deb
  #2  
Old June 18th, 2008, 03:53 PM posted to microsoft.public.access.forms
Dennis
external usenet poster
 
Posts: 1,222
Default text box to update multi fields in table

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

"deb" wrote:


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
--
deb

  #3  
Old June 18th, 2008, 05:23 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default text box to update multi fields in table

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

--
Dave Hargis, Microsoft Access MVP


"deb" wrote:


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
--
deb

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:33 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.