Normal Topic No Code unless in Add Data Mode? (Read 820 times)
chaven
Member
*
Offline


There's no way out of
here...

Posts: 18
Joined: Apr 2nd, 2013
No Code unless in Add Data Mode?
Apr 10th, 2013 at 4:33pm
Print Post Print Post  
I am working on an application that lets our HR department add and update the dates that an employee received training or attended safety meetings. 

While building the main form I added some drop down (combo) boxes to make selecting employees easier; the list pulls from another "Employee" database that can be updated.  My problem, is I cannot seem to get any code placed within the combo boxes to work unless I am in "Add Data" mode.  I would like the boxes to be able to run code while in search/update mode but they do nothing. 

I have searched around and I am sure there is an easy explanation but, no dice...

I have attached what the application looks like:

The 3 combo boxes at the top auto-update as the user makes selections.  This works fine in ADD MODE, but only the  first box will populate if I enter search/update modes.

Any ideas?
  

example.jpg ( 137 KB | 33 Downloads )
example.jpg

...when you come in, you're in, for good.
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: No Code unless in Add Data Mode?
Reply #1 - Apr 10th, 2013 at 4:46pm
Print Post Print Post  
I'm not sure if this is what you are describing...

But there are four modes:
Application Mode - the mode you are in before you select a form / database
Search Mode - the mode that lets you search for existing records
Update Mode - the mode that lets you edit existing records you found while in search mode
Add Mode - the mode that lets you add new records without previously finding existing records

Add mode and update mode both run ordinary event programming. Application mode and search mode prevent ordinary event programming from running and have special programming just for those modes.

When you are testing Search/Update mode, are you retrieving any records before testing the SBasic, so as to place you in update mode, or are you trying to run the SBasic while still in search mode? If for example, you have no records yet, the mode will not switch from search to update.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
chaven
Member
*
Offline


There's no way out of
here...

Posts: 18
Joined: Apr 2nd, 2013
Re: No Code unless in Add Data Mode?
Reply #2 - Apr 10th, 2013 at 4:46pm
Print Post Print Post  
Correction:

Looks like if I enter the form in ADD MODE (which it does anyways for code reasons) then "F7" to enter Search, then immediately "F10" to pull all records and enter Update mode....the combo boxes do indeed update.  But still not in Search mode where they would be the most useful.
  

...when you come in, you're in, for good.
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: No Code unless in Add Data Mode?
Reply #3 - Apr 10th, 2013 at 4:49pm
Print Post Print Post  
You need to put the code in the "On Retrieve Spec Open" event.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
chaven
Member
*
Offline


There's no way out of
here...

Posts: 18
Joined: Apr 2nd, 2013
Re: No Code unless in Add Data Mode?
Reply #4 - Apr 10th, 2013 at 8:35pm
Print Post Print Post  
Thanks for the reply.  I've gone ahead and made some major redesign decisions...I was making things WAY more complicated than they needed to be.
  

...when you come in, you're in, for good.
Back to top
 
IP Logged