I have created a Database which stores data of Printers and PC's which have reserved IPs on the DHCP server. I will tell you some details first:
There are 2 tables:
Some things to note:
1.There can be only one mac on any given switch/port at a single time
2.You can have duplicate printers with different names ie payroll and admin, that have the same MAC and IP .
3.There can be only one IP reserved for one MAC address
If you had to change the mac or IP for one of the printer, you will need to update the other printers which use that MAC or IP plus update the MAC on the switch
My question to you guys is this:
How do I this, I have no relationships in the database so far I have been using subform and lookups to display the data but now I need to do this, can any one help me?
hmmm, sounds like you need to carefully layout how you need this to be structured. In relationships, there is something called "referential integrity" which enforces the rule that child records must have a parent. Along with this is the option of cascading updates and cascading deletes. Base don what I think you are looking for, these will do what you are looking for.
Another approach would be to use code that opens recordset (or queries) to check and update the information. This can be bulky to setup, especially in a multi-user environment, but gives you control over the process (there are instances whare referential integrity can be annoying, problematic and a serious pain in the neck).
Try the first option (in a copy of your database) and see if that solves your problem. If it does, you just saved a bunch of wok.
But maintaining relationships is easier than maintaing code or queries especially in a development environment... You need to: identify your data objects (unique entities); create tables based on those with the correct indexes; and then create relations between those tables. Sorry I can't be more specific, but I'm uncertain what those entities might be.