Hi, All.
I am just beginning to get into the area of passing variables as needed. I have a good grasp of the concepts, it is just the code to make it happen that is where I am just getting going.
For this I have several pictures so you can see exactly what I have set up and I will do my best to explain as I go.
As we all know, in databases we use normalization to help make things work better. So, I have accumulated multiple tables and each are 'codes' tat I use in different part of my DB. However, the table structure is exactly the same for each table, so there is no point in building a separate form for each code!
GOAL:
When a command button is clicked on a form it is assigned to open this popup form and display a specific list of codes.
1. Before the form opens the labels of the form are set
2. Then the Recordsource and controls properties are set
3. The form opens and is populated with the list of all of the codes from the table corresponding to the button pressed.
Likewise, when the user is DONE, there should be a routine that dose the reverse and deletes all the information it just put in about the code they were just working on to keep any confusion from happening to another code table.
I know this is probably pretty easy, I just have not done it very much yet meaning using the same form over and over.
For me it is just about building the skill of creating those routines that handle this stuff.
So, allow me to show you a few pictures of what I have so far.
Here is a picture of the form itself. It is set up as a POPUP form.
In the example below it is showing a list of ADDRESS TYPES.
In regards to the code status, here is the business rule:
Let's say at some point we stop using PO Boxes as mailing addresses.
BUT, we have 5,000 customers who have a PO Box on their records.
We are not going to tell them they have to stop using them, we just don't let NEW
customers use them!
So, on this screen the person maintaining the database can pull up the address
types and just change PO BOX from ACTIVE to INACTIVE.
The combo boxes throughout the DB are dependent on a QRY that only displays ACTIVE
codes!
Form Name: PFrmCodeEditF
See text field labels names in header
Text Control: txtCodeName
Combo Box Control: cboCodeStatus
Here is the Address Type Query. Someone correct me if I am wrong, but I have no use for the PRIMARY KEY
field on my form. Once I saved and reopened this the primary key field was gone. The only two field I care about are
such as in this case AddressType and StatusID.
Just for the hell of it, here is another code I use so you can see that the structure is the same
For the StatusID fields here is a list of the choices:
I am just beginning to get into the area of passing variables as needed. I have a good grasp of the concepts, it is just the code to make it happen that is where I am just getting going.
For this I have several pictures so you can see exactly what I have set up and I will do my best to explain as I go.
As we all know, in databases we use normalization to help make things work better. So, I have accumulated multiple tables and each are 'codes' tat I use in different part of my DB. However, the table structure is exactly the same for each table, so there is no point in building a separate form for each code!
GOAL:
When a command button is clicked on a form it is assigned to open this popup form and display a specific list of codes.
1. Before the form opens the labels of the form are set
2. Then the Recordsource and controls properties are set
3. The form opens and is populated with the list of all of the codes from the table corresponding to the button pressed.
Likewise, when the user is DONE, there should be a routine that dose the reverse and deletes all the information it just put in about the code they were just working on to keep any confusion from happening to another code table.
I know this is probably pretty easy, I just have not done it very much yet meaning using the same form over and over.
For me it is just about building the skill of creating those routines that handle this stuff.
So, allow me to show you a few pictures of what I have so far.
Here is a picture of the form itself. It is set up as a POPUP form.
In the example below it is showing a list of ADDRESS TYPES.
In regards to the code status, here is the business rule:
Let's say at some point we stop using PO Boxes as mailing addresses.
BUT, we have 5,000 customers who have a PO Box on their records.
We are not going to tell them they have to stop using them, we just don't let NEW
customers use them!
So, on this screen the person maintaining the database can pull up the address
types and just change PO BOX from ACTIVE to INACTIVE.
The combo boxes throughout the DB are dependent on a QRY that only displays ACTIVE
codes!
Form Name: PFrmCodeEditF
See text field labels names in header
Text Control: txtCodeName
Combo Box Control: cboCodeStatus
Here is the Address Type Query. Someone correct me if I am wrong, but I have no use for the PRIMARY KEY
field on my form. Once I saved and reopened this the primary key field was gone. The only two field I care about are
such as in this case AddressType and StatusID.
Just for the hell of it, here is another code I use so you can see that the structure is the same
For the StatusID fields here is a list of the choices:
Last edited: