By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,671 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,671 IT Pros & Developers. It's quick & easy.

Help with access queries and logic

P: 69
This question isn't relating to some specific piece of code, but more along the lines of the logic or best method I should use with access 2003 and VBA. I am new to access programming and I am unsure about the best way to get this done. So, let me attempt to explain what I am looking to do.

I am building a database to keep track of quotes given out by a company. Pretty much they want a quote form, that they can bring up and put the quote information into, such as model numbers, options for that model and prices and weights for shipping purposes. I have three tables to work with, models, options, and skid. The models and options are pretty self explanatory, and the skid table is info for calculating the shipping costs. I set up the form using a combo box to bring up the model info, and then another combo box with a SELECT statement to bring up available options for that model. But then later on in the form, I want to use a couple of variables I have saved from the SQL statements in the combo boxs to build another SELECT statement to get the information I need from the skid table. But the problem I am having is that I can't just do a DoCmd.RunSQL with a SELECT statement to get the information I need from the skid table. I guess I could change my SQL statement from the model combo box and also grab any relevant information from the skid table at that time and assign it to a variable for later use, but I don't know if that is the best way to go because it is all information that is used behind the scenes to make a few calculations. It just seems like I am missing something and there is a better way to go about this. Any thoughts, help or ideas would be greatly appreciated.

Thank you
Oct 8 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 3,072
The general approach is to link the tables with needed information and perform the calculation in the query. This way you always have the most accurate values.

Another option is to us the Dlookup() function to extract the needed information in code or as the formula for an unbound field. It's slower as a linked table, but sometimes a good alternative.

Oct 9 '07 #2

P: 69
Sweet, thanks for the advice. I will give them each a try and see what works better for me.

Oct 10 '07 #3

Post your reply

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