473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Retreive value from a table based on a value on a form

41
This is continuing form my list box question, which i now realise is probably not really linked to list boxes at all!

If i have a field on my form that holds the value of a unique autonumber for another table is there a way i can then do a check on that table and return some other values from that record?

e.g.

my table has 4 columns, (a,b,c and d) i know the value of column a, which is unique.

My form is not bound to this particular table.

What i need to do is check the right table and return the value from column c and d for the record I have the value in column a for.

thanks
Jan 11 '08 #1
3 1361
MikeTheBike
639 Expert 512MB
This is continuing form my list box question, which i now realise is probably not really linked to list boxes at all!

If i have a field on my form that holds the value of a unique autonumber for another table is there a way i can then do a check on that table and return some other values from that record?

e.g.

my table has 4 columns, (a,b,c and d) i know the value of column a, which is unique.

My form is not bound to this particular table.

What i need to do is check the right table and return the value from column c and d for the record I have the value in column a for.

thanks
Hi

I can think a 3 ways immediatly but by fare the best is (IMHO) to return the value in the List Box Control Source query. These would be retainin in zero width columns an refered to (returned) in VBA by the list box Column property.

So in the List_AfterUpdate event you can set a variable(s) to the column(s) value for the row clicked.

??

MTB
Jan 11 '08 #2
zaidlig
45
Use Dlookup when you need to find a value in a non-related table.

DLookup(expr, domain[, criteria])

in your case DLookup("[b]", "Other Table name", "[a] = selected value from form")
Jan 11 '08 #3
Craggy
41
Excellent, thanks for your help!
Jan 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Not4u | last post by:
I would like to know which products are my best sells by sellers, but i would like to retreive this info by product id, seller id and the total amount of sells for this product. My Sells table...
16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
4
by: dmiller23462 | last post by:
So here's my problem.....I need to set up different email distributions based on which option in the following Select form has been chosen....For instance if "Putaway" is chosen it needs to email...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
3
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
0
by: Umut Tezduyar | last post by:
I have a control derived from ComposeteDataBoundControl. Control doesn't retreive it's state information. I am going to frick out! What should I do more? I added two codes. One is for Default.aspx...
2
by: Umut Tezduyar | last post by:
I have a control derived from ComposeteDataBoundControl. Control doesn't retreive it's state information. I am going to frick out! What should I do more? I added two codes. One is for Default.aspx...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
5
by: vsteshenko | last post by:
Hello, This is my second post to the any usernet group and the first one was posted to the wrong one. I am currently working on creating an order form for sales associates at my work to be used...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.