Normal Topic duplicate forms (Read 721 times)
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
duplicate forms
Apr 5th, 2013 at 3:22pm
Print Post Print Post  
Just a confirmation needed!

Two basically duplicate forms in the same database will have all the same information in them?  Correct?

You could add a record in form A and it will also be in Form B?  I want to set up slightly different forms for different users.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: duplicate forms
Reply #1 - Apr 5th, 2013 at 5:46pm
Print Post Print Post  
So long as the elements are bound to the same fields of the database, it should be the same. But you can also display and hide elements of the form depending upon the user using If @UserID ( ) command. You can also make the group of users and define there access accordingly. The same form can look and work different for different users. You can also have individual element behaves different for different users.

I have divided users into different groups here:

Code
Select All
//Code on Form Entry

If UDF_LevelOneCheck () = "Passed" then
	{

		//Visibility (PastVisits RW, 1)
		Visibility (PastVisits RB, 1)
		Visibility (Tracker, 1)
		Visibility (Est_Data, 1)
		Visibility (SelectVisit, 1)
		Visibility (AddNote, 1)
		Visibility (IMM_Record, 1)
		Visibility (PrintRecord, 1)
		Visibility (Activity, 1)
		Visibility (DocManage, 1)
		Visibility (NCPDPID, 1)
		Visibility (Pharmacy, 1)
		Visibility (Panel Feedback, 1)
		Visibility (MakeClientR, 1)
		Visibility (Client, 1)
		Visibility (SendLetter, 1)
		Visibility (Activity Report, 1)
	}

	Else
	{
		//Visibility (PastVisits RW, 0)
		Visibility (PastVisits RB, 0)
		Visibility (Tracker, 0)
		Visibility (Est_Data, 0)
		Visibility (SelectVisit, 0)
		Visibility (AddNote, 0)
		Visibility (IMM_Record, 0)
		Visibility (PrintRecord, 0)
		Visibility (Activity, 0)
		Visibility (DocManage, 0)
		Visibility (NCPDPID, 0)
		Visibility (Pharmacy, 0)
		Visibility (Panel Feedback, 0)
		Visibility (MakeClientR, 0)
		Visibility (Client, 0)
		Visibility (SendLetter, 0)
		Visibility (Activity Report, 0)

	}

If UDF_LevelOneCheck () = "Passed" then
	{
		ReadOnly (IHCExempt, 0)

	}
	Else
	{

		ReadOnly (IHCExempt, 2)
	}



If @Mode () = 1 and UDF_LevelOneCheck () <> "Passed" then

	{

		Readonly (Chart, 2)
	}
	Else
	{

		Readonly (Chart, 0)
	}
 

  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: duplicate forms
Reply #2 - Apr 7th, 2013 at 9:56pm
Print Post Print Post  
Bharat brings up a good point. If you can do what you need by hiding or showing various layout elements, this will save you from having to always duplicate any changes to common programming in all of the various forms (layouts) for the same database. I usually use this approach.

But, if you need to relocate many of the elements on the form to give it a totally different look, it may be worth going with multiple forms.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: duplicate forms
Reply #3 - Apr 8th, 2013 at 12:47pm
Print Post Print Post  
You many also use #include files to avoid duplicating much programming.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged