Mariano Posted January 12, 2006 Posted January 12, 2006 I couldn't find any info on this in searches, I apologize if this topic has been discussed before. I have a file that manages job sites for an elevator company...What I need to try and do is create a button that adds a field to a layout. Unfortunately I am the only person using the db that is familiar with FM so asking people to create a new field in layout mode isn't really practical. For example- I have 10 fields labeled "Passenger Car1" - "Passenger Car10", However 10 maybe more than enough fields for a project, or not nearly enough for others. I dont mind displaying 10 fields for the projects that have less than 10 Cars, but I need to write something that will add "Passenger Car11" and up when needed. Any recommendations?? Thanks!
Ender Posted January 12, 2006 Posted January 12, 2006 There is no way to script this. You would need to give access to someone to edit layouts, give users the choice of a 10 field layout or a 15 field layout, etc., or give them a 10 field layout with the option to choose which fields are displayed.
mr_vodka Posted January 12, 2006 Posted January 12, 2006 There is no way to script creating a new field. Also you should rethink about how your database is setup. Instead of creating 10 fields for car1 through car10, you should have a related table that has the cars in it. In other words, currently it seems as though you have a setup where in a Table called Projects you have the following: Projects ProjectNum ProjectName PassengerCar1 PassengerCar2 PassengerCar3 ... What you should have are at least two tables Projects ProjectNum ProjectName Cars ProjectNum PassengerCar By setting your database up like this, your users can enter as many or less cars as they want.
Mariano Posted January 12, 2006 Author Posted January 12, 2006 Thanks for the quick reponses! Perhaps a second table would be the way to go.. but I am not totally convinced. Right now I have each job as its own record. The first layout is Job Description, 2nd layount is Cars, 3rd Layout is Hydraulics, 4th layout is Escalators, 5th is Permits, and the 6th is Layout Drawings. I am still learning FM, I do undertand tables, but I am not sure I get the advantage of doing a different table in this type of layout. Would you mind explaining? I am still trying to figure out the best way to do things in FM. Thanks again!
sbg2 Posted January 12, 2006 Posted January 12, 2006 Get convinced! What you describe is the reason Relational Databases were created. When you start thinking I need the same field repeated X number of times for each record, 99% of the time those records should be in a seperate table. You have a Job and each Job can have 0 to X (10? 15?25?... maybe only 1) number of Cars, the cars then belong in a seperate table. I have attached a sample file. You should also start looking at the help file, try a search for "About single-criteria relationships". MyDB.zip
Mariano Posted January 12, 2006 Author Posted January 12, 2006 Ok.. your example makes sense to me. And I do understand how that works. But I dont think I explained this as well as I should have. The cars aren't make or models, its actually how the contractor groups them for installation. For Example- Maybe he will choose to install passenger cars 1-6 at one time, 7-10 6 months later, and service cars 6 months after that. I need to designate that grouping. Some jobs maybe do them one at a time. So its always different... I dont know if I could set up a car table because of that. Or am I misunderstanding this?
sbg2 Posted January 12, 2006 Posted January 12, 2006 Can you upload an empty copy of your database or at the very least create a quick sample of how your database is set up?
bruceR Posted January 14, 2006 Posted January 14, 2006 Ok.. your example makes sense to me. And I do understand how that works. But I dont think I explained this as well as I should have. The cars aren't make or models, its actually how the contractor groups them for installation. For Example- Maybe he will choose to install passenger cars 1-6 at one time, 7-10 6 months later, and service cars 6 months after that. I need to designate that grouping. Some jobs maybe do them one at a time. So its always different... I dont know if I could set up a car table because of that. Or am I misunderstanding this? Yes, you are misunderstanding. The dedicated field number (Car1, Car2, etc) are absolutely positively NOT the way to do this. Also, you have added some further information about scheduling that suggests that you need to make further refinements in your interface, so you can indicate the install date or service dates. You may want to learn about the subject of "filtered portals".
T-Square Posted January 15, 2006 Posted January 15, 2006 I might consider adding the Group, Installation Date, and Last Service Date as attributes of the Cars table. By that I mean, add fields for Group, InstallDate and LastServiceDate. As a further point, if the Service schedule is at fixed intervals (e.g., six months, as you imply), then you could create a calculation that would identify when each Car should next be serviced, based on LastSvcDate and InstallDate. Then, your staff would simply note the LastServiceDate for the different cars, and a report of Cars needing service can quickly be built. David
Recommended Posts
This topic is 6890 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now