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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get data from one field based on the input of another 2

Status
Not open for further replies.

Bill4tektips

Technical User
Aug 5, 2005
175
GB
I have two tables, tblFeedback and tblBMS_Documents. I have a Form called frmFeedback in which there is two fields called ProcessNumber and ProcessTitle. What I am trying to do is get the ProcessTitle field to fill in when the ProcessNumber field is filled in. The table tblBMS_Documents holds the base information as to Process Number and Process Title. In the ProcessNumber field I have the Row Source as "SELECT tblBMS_Documents.DocumentNumber FROM tblBMS_Documents;" but I do not know how to get the ProcessTitle field to update to add the Title.
 
Why not simply follow the combo wizard ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi

Assumning ProcessNumber is a combo box, with two columns, ProcessNumber and ProcessTitle, in that Order

in the after update event of ProcessNumber

ProcessTitle = ProcessNumber.column(1)

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
How are ya Bill4tektips . . .

Accessing the table directly you'd have the following in the [blue]AfterUpdate[/blue] event of ProcessNumber:
Code:
[blue]   Dim Cri As String
   
   Cri = "[ProcessNumber] = [red][b]'[/b][/red]" & Me!ProcessNumber.Column(0) & "[red][b]'[/b][/red]"
   Me!ProcessTitle = DLookup("[ProcessTitle]", "tblBMS_Documents", Cri)[/blue]
.
Note: if ProessNumber is numeric, remove the two single quotes in [red]red[/red] . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Hi Guys. I'm afraid I can't get any of your suggestions to work. PHV - sounds like a good idea if the wizards hadn't been stripped out by our IT people. KenReay - I only have 1 column in my ComboBox ,ProcessNumber, because that is all I need displayed in that field but I need the ProcessTitle field to populate depending on the ProcessNumber selected. TheAceMan1 - I just cannot get your suggestion to work. Any more ideas?
 
Why not have two columns in the combo, and if you do not want it dispalyed then set column width of the second column to zero, then use code I posted?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
KenReay - That works OK although I had to add Me! in front to read "Me!ProcessTitle = Me!BMSProcessNo.Column(1)"
Thanks for that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top