Normal Topic Layout Open - Search and Add mode at the same time (Read 786 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Layout Open - Search and Add mode at the same time
Apr 22nd, 2013 at 7:57pm
Print Post Print Post  
I have a layout with a couple of subforms in there. If I have the layout open in Add and search mode at the same time, I get unpredictable results while processing subforms of record open in add mode. It picks up subrecords info from the record open in the search mode.

What I hope to do to in order to avoid a mistake, to give warning if the same layout is open in search mode and ask the user to close that before processing the subform.

Is there any way to check if the layout is open in search mode, while working on the layout in the add mode?
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Layout Open - Search and Add mode at the same time
Reply #1 - Apr 22nd, 2013 at 9:51pm
Print Post Print Post  
I'd rather fix it than prevent it. Can you provide steps in one of the sample databases to reproduce the condtion?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
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: Layout Open - Search and Add mode at the same time
Reply #2 - Apr 23rd, 2013 at 4:22pm
Print Post Print Post  
I have been trying to establish the exact chain of events before manifesting the subject unpredictable results while processing subform records. Once I nail that down with my application, I will try to reproduce that with sample application. Thanks for response.
  
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: Layout Open - Search and Add mode at the same time
Reply #3 - Jun 21st, 2013 at 9:38pm
Print Post Print Post  
The solution offered by by Ray in the following thread

http://lantica.com/Forum4/cgi-bin/yabb2/YaBB.pl?num=1362519415/20#20

in the form of following code helped to identify if the form with subform is open in Add as well as Update mode.
Code
Select All
If @FormResultSetTotal("Inventory:(Update)") = -1 Then
{
	//Do stuff
}
Else
{
	@MsgBox("Inventory Form is open in Update Mode. Please close and try again", "", "")
}
 



Hopefully, as Mark pointed out, I will zero in on the cause of this unexpected behavior but this will help to prevent vital error. Thanks Ray.
  
Back to top
 
IP Logged