Filtered TextBox Value

I have the text box set now to get the field that I created with the concatenated values. The text box looks at the metal chosen in the cboMetals and returns the concatenated field for that record. How do I now tell it which of the 4 values I want? I am trying to do this by using the columnHeads property, but I cannot figure it out.

Thanks.
 
This is my statement so far with the first criteria.

=DLookUp("[MetalPrices]","OptionMetalsListQ","[MetalsID] = " & [cboMetals].[Column](0))

The next criteria is that the column head of the concatenated value is equal to the string value within a combo box cboMetalMarket. These values are LME, COMEX, LMBA, and EnglehardFab.

My concatenated field within the query is:

MetalPrices: [LME] & " " & [COMEX] & " " & [LMBA] & " " & [EnglehardFab]
 
The criteria is the cboMetalMarket combo box selection. There is a price for each metal for each market. Right now my text box is returning all of the prices for the selected metal. I want only the price for the market selected.
 
Upload a cut down version of your db, and talk me through it. Would be easier to see it.
 
Thank you so much for all of your help. You have no idea how much I appreciate it.
 
I got it to work with an If Statement within the AfterUpdate event of the cboMetalMarket.
 
Here is a screenshot of the VBA Code. I am much more familiar with If statements than the DLookUp function. I don't know why I didn't try this first.

vba after update prices.PNG

Thanks again for all of your help. I will probably be asking more questions.
 
Last edited:
Looks good, but it wasn't necessary. If you were going to use a DLookup() it would have been something like this:
Code:
=DLookup(cboMetals, "OptionMetalsListQ", "MetalID = " & cboMetals & " AND MetalMarketID = " & cboMetalMarket)
... however, and unfortunately, that won't work because of the following reasons:

* your tables still aren't setup properly - the biggest issue highlighted several times already
* your use of the Bound Column property of the combo box is wrong. The bound column should be 0 where the first column in the query is the ID that uniquely identifies each record.

Again, we're back to the issue about your tables! I've advised several times that you should seek help in restructuring your tables but when you do, you end up seeking help that would resolve your immediate problem.

With your current setup, you're bound to continue having problems because it's far from ideal, and I mean far.
Well, it's up to you now to decide your next cause of action, but I won't be raising this topic anymore ;)
 
When I make the bound column to be the ID field the value in the table is the ID field, not the name like I want. when I created the combo boxes I made them from queries using the wizard. I want to store the text field in my tables not the ID number. I understand that the ID field is necessary to uniquely define the record, but how do I have both?
 
Still trying to workaround your biggest problem. At this point, nothing I will say will help solve any of your other problems simply because of your tables.
* your tables still aren't setup properly - the biggest issue highlighted several times already
 
In my tables do I need an ID field for each of my combo box values and a text field? I am really trying to understand how to fix the problem.
 
Conner, you need to understand that table normalisation is a process. It's not a quick fix, it's an entire process you have to go through where:

* each and every table is scrutinised
* broken down (if necessary)
* relationships between all (or some) of the tables established
* referential integrity setup

Again, it's a process. Now can you understand why I've been saying that you should seek help and explain your entire model?
 
Yes. I am just so far into all of this that I guess I am scared to go through the entire process because of my situation. I am doing a summer internship and my boss wants me to be done with this database by the end of June. I will just have to go back and do the process and hope I can move faster once completed. I have made some serious progress in understanding how everything works together, but too little too late for me.

I apologize if I have irritated you in any way. It was not intentional. I am really trying to understand everything and implement it in my database. I am just moving too fast and now that is coming back to bite me. Thank you again for all of your help. I would be really struggling if I had never found this forum.
 
If you want we can go through the process but I will need to understand your entire business model and see screenshots of what you currently have.
 
I would love to go through it with you.

I think the only tables that I will need to take out is the customers and suppliers tables. After that I can post my current database if that will help, or I can just start from scratch. which ever you think will be most beneficial.
 
Yes. I am just so far into all of this that I guess I am scared to go through the entire process because of my situation.
Once you get the process done and dusted, you will find that everything else, i.e. creation of forms, queries and reports will move like clockwork.
 

Users who are viewing this thread

Back
Top Bottom