no it doesnt let you do that i just lets you choose where you get you combo box info ive attached a copy of the db to show what i mean
no it doesnt let you do that i just lets you choose where you get you combo box info ive attached a copy of the db to show what i mean
Start by removing your Lookup Fields: http://www.mvps.org/access/lookupfields.htm
...and here's how: http://www.btabdevelopment.com/ts/removelookups
but do i not need the look ups to get the vehicle regs in the first place from another table vehicles?
Having the Lookup's (ComboBoxes) on your form is just fine and exactly what you want. Just not at the table level!
Arh ok that makes sense ive now changed that, so is that a general rule not to use cbo at table level or only when then trying to run a macro or code used with it.
Did you read the link I posted? Developers *never* use them, period!
A few other rules of thumb:
1) Unless you will be doing math with the field a number should be a String field (like the Tech_ID field)
2) Normalization rules require your PrimaryKeys be stored as ForeignKeys when you need to create the relationship. The TEXT description should *only* be located on one table. Vehicle_Lease_Company field in the Vehicle table s/b the LeasingID PrimaryKey in the Vehicle_Leasing table, not the name.
yes i did, and i think i now understand why, so at table level there should be no reason you use one as you wouldnt really add data at that level anyway so it will not get in the way of anything later in the design, and any information would come from your forms where the cbo are ok to use. i think iim getting it a little now.
When Lookup Fields are used it is very difficult to see what value is actually in the table and generally that confuses the programmer. I know it does me.
Ive now gone back through my tables as i used cbo's all over the place so now i think i have a better basis to create my db only now using cbo's in my forms
Good. How about posting your db again so we can stay in sync?
Please find attached
this is the sort of line im trying
SearchForRecord
Object Type Table
Object Name Tech_Vehicle
First
Condition
[Forms]![Tech_Vehicle]![Vehicle_Reg]=[Tech_Vehicle]![Vehicle_Reg]&[Tech_Vehicle]![Date_Returned] IsNull(
im trying to say search for first record where the form vehicle reg = a reg on the tech table with no date_returned which would be is null, but when i put the isnull it gives me a ( and asks for an expression i thought the isnull would of been the end of it. ??????? confused
Some more useful rules for maintaining a db in Access.
1) Whenever possible use an AutoNumber as the PrimakyKey (PK) of a table.
2) Give that PK a useful name representative of the table it is in, not just ID.
3) When you use that PK as a ForeignKey (FK) in another table then name the fields the same. It is a lot easier to understand years later.
More suggestions:
1) Cascading Updates and Deletes are way too powerful for me. I prefer to do that work myself. Just a suggestion.
2) Once a good FK is in a table, any related field from either table can be displayed and modified as if it were in one table using a query. *Very* powerful concept!