Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate fields in a table when a form field is filled

Status
Not open for further replies.

schltzy99

Programmer
Feb 11, 2002
33
US
I am rather new to Access so please bear with me. I would like to know if anyone can help me to do this:

I have a form, frmInitialScreen,
that has a field, initial_screening
with a control source: Initial Screening A/R/H.
This field is composed of a value list: Accept, Reject, Hold.

Is it possible to have this field, once "ccept"is selected, to have it populate 2 more fields in the table, tblProspect (This is the same table that the above field is in)?
The fields are:
sme_screening
overall_screening

I apologize if this is very remedial, I'm just a tad perplexed. Thanks in advance. RSchultz
rschultz@insolsys.com
**Access 2000**
 
I think all you have to do is let the two controls equal the listbox value.

Use this code:

[sme_screening] = initial_screening
[overall_screening]= initial_screening

as long as the listbox has the name initial_screening then you're fine.

Hope this helps,
NG
 
NewfieGolfer is on the right track but I think you want to populate the FIELDS with values other than the contents of initial_screening - don't you.

The code in the previous post will work IF sme_screening and overall_screening are CONTROLS on the form. There is a risk, depending on the set-up of your compiler that it won't work if sme_screening and overall_screening are just names of FIELDS in the Table that do not have CONTROLS of the same name.

Assuming that the form frmInitialScreening is BOUND to the tblProspect, if you want to set the contents of the FIELDS directly use the Me! qualifier.

In the CONTROL ctlInitialScreening After_Update event put

Private Sub ctlInitialScreening_AfterUpdate()
If ctlInitialScreening = "Accept" Then
Me![sme_screening] = smeValueToBeSetTo
Me![overall_screening]= overallValueToBeSetTo
EndIf
End Sub


'ope-that-'elps.

G LS
 
Thank you a lot...he was on the right track but you are on the money!

:eek:) RSchultz
rschultz@insolsys.com
**Access 2000**
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top