Sorry it took so long to answer you but I had to go and do other things
rvd48 said:
lol, i sussed it, i put the 'defalt value' field as '1'.
Good: The old grey matter is starting to work.
is there a tutorial for this 'orders' template in Access?
Not that I know of ------ be your own tutor, Pull it apart, change things, study the code behind forms and controls etc. You can’t do any damage if you mess it up just delete your experiment and start with a fresh sample again.
Don’t be “afraid” to learn. If you want to know how to do something pull it apart until you understand what makes it tick.
One of my favourite learning tools for code used to be to create a macro, convert it to VBA (tools; Macro’s; Convert macro’s to vb) and see how MS write it in code.
There is nearly always a better way to write the code but it gives a good starting point. As you search the help files in VBA you will learn how to code for different things. Untill you write things without thinking about it like ----------- DoCmd.OpenForm "MyForm", acNormal, "", "", acEdit, acNormal----------and it no longer appears gobeldegook.
for me to select a component from the drop down list, should i make a query which has all the component tables selected? hence, i could make a 'look up' in table design which would use the query.
You could but you may end up with “Heavy” tables that will run slow. It depends on how many lookup operations.
Look at the “Cascading combo boxes” example in the code repository. It will give you an idea of one way to achieve what I think you need.
Think about the make up of a component and the way you need to use the information. This will give you an idea for an initial table structure for this problem.
Here is one possible
- Component
- Manufacturer
- Architecture
- Model
- Purchase price
- Your retail price
Now: If you make a table for each of the first four items and link them, store your prices in the table called Model then your cascading combo boxes could work thus:
In first combo box pick a component. Your next combo box will then list manufacturers of that component; pick manufacturer: your next combo box will give you archi........... And so on.
When you have picked a component then your prices can be displayed. But you need to think about this also ----- you may have to build some machines to a budget, in which case you may need to see all the information at once on a particular group of components.
When you need to update your component list then you, mostly, only have to update two tables, Model and Purchase Price, Occasionally you will have to add to the Architecture table. Your Retail price should be a calculation from the purchase price so you will never need to touch that.
You may like to include other stuff like a discount structure or an “Obsolete Component” Routine. That you must decide from your business model.
Another way you could do this is to use a combo box to pick components and then have a list box that displays the other information (a bit like a data sheet) then you have all the possible permutations displayed in front of you and you can pick from a list.
There are lots of other ways .
One of the good things about programs like Access is that they are very flexible and will let you do, more or less, what you want. You just have to figure out a way of achieving it.