Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking forms to main form by "user id" field

Status
Not open for further replies.

subcan

Technical User
Oct 1, 2008
1
US
I have been working on a database for a couple of months and I have been really stuck on one concept and cannot get my mind around it.
right now I have a main form that has a tabbed subform in it. It contains a lot of different information and would rather have a main table/ switchboard where I could have the user select who's data they are adding/editing.
Then have command buttons that would link to all the different forms to input data for that 'userid' only and not show other none related info.
for example my DB is tracking info about everything to do with the person. from SSN, medical records, home of record, awards recieved, all items that have been issued (with serial numbers), etc...
I also want to track a lot of other things regarding these people over the course of a year. This involves a lot of tables and forms.
Is this even possible? It has really brought to an impass.
Any help would be greatly appreciated.
Subcan
 
This sounds familiar! I have a databse that stores info about residents in a care home. In the main form the user chooses the resident from a drop down combo and then the tab control contains subforms called "frmSubMedication","frmSubDiet", etc.

These subforms are all based on queries that have form!Myform!PatientID built into their criteria so they ony ever show info about the person chosen in the form.

Wouldn't the same idea work for you?

JB
 
I've done a lot of customization similar to what you describe, I'll break it down conceptually (its too much to go into detail right off).

1) database opens the main menu at startup (tools|options...)

2) main menu Form_Open calls a function in the general module SetPermissions

3) function SetPermissions queries ms-windows for the logged on user name, matches that name to an entry in my Users table, and sets several global variables such as SEC_EditDate

4) Back to main menu Form_Open (and any other forms in the database),
if SEC_EditDate = true then btnDate.enabled = true else btnDate.enabled = false

You can lock fields, make controls invisible, lock forms, move buttons around, its limitless.



Now if you want to do it based on record, it would be pretty similar. You could use a combo box and call a sub RebuildForm after update. The sub RebuildForm could hide controls, tabs, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top