ironfelix717
Registered User.
- Local time
- Today, 08:29
- Joined
- Sep 20, 2019
- Messages
- 193
Hi,
A common feature my apps require is getting a user selected value from a universal popup form and using that value in a sub.
I have been lousely designing such forms where they are passed an input (open args) and based on that arg, the form passes to the next function in the stack. Heres a written/sudo example:
In the "sales" form:
	
	
	
		
Selection_Form is opened.
User makes selection.
Select Case determines next function in stack to be called.
In this case, it is a routine in the "Sales" form called "ChildFunction"
"ChildFunction" is called from Selection_Form and passed a value.
Back to the sales form:
	
	
	
		
This is obviously a very lousy way of doing things and creates a troubleshooting havoc.
What I would like to do is treat these universal popup forms as a variable, such that you would see with built in "InputBox" or "MsgBox".
Example:
	
	
	
		
Using a class object is fine, but a simple function would be the cleanest solution.
Is this possible? I assumed it wasn't so I never dug into it. Hoping we can find a solution!
cheers
 A common feature my apps require is getting a user selected value from a universal popup form and using that value in a sub.
I have been lousely designing such forms where they are passed an input (open args) and based on that arg, the form passes to the next function in the stack. Heres a written/sudo example:
In the "sales" form:
		Code:
	
	
	Private sub ParentFunction()
docmd.openform "Selection_Form",,,,,"Sales"
end subSelection_Form is opened.
User makes selection.
Select Case determines next function in stack to be called.
In this case, it is a routine in the "Sales" form called "ChildFunction"
"ChildFunction" is called from Selection_Form and passed a value.
Back to the sales form:
		Code:
	
	
	Public Sub ChildFunction(value)
DoSomething with value
end subThis is obviously a very lousy way of doing things and creates a troubleshooting havoc.
What I would like to do is treat these universal popup forms as a variable, such that you would see with built in "InputBox" or "MsgBox".
Example:
		Code:
	
	
	Private Sub ParentFunction()
dim val        as integer
val = SelectionForm()  'selection form is opened and code is halted until closed
'do something with val'
end subUsing a class object is fine, but a simple function would be the cleanest solution.
Is this possible? I assumed it wasn't so I never dug into it. Hoping we can find a solution!
cheers
 
	 
 
		 
 
		 
 
		 
					
				 
						
					 
 
		 
 
		 
 
		 
 
		