If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Brilliant Database > Help with Controlling Visibility of Fields using Variables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Location: Huntsville, AL
Posts: 256
Help with Controlling Visibility of Fields using Variables

I have a sheet that has two Many-To-Many Relationship fields. Only one field should show on the sheet - the particular MMR field that appears on the sheet should depend on the users actions. The scripting contains a line that either states [$status]=1 or [$status]=0 (I set this variable up as a 'global' variable since it appeared that this was necessary). On the 'Edit and Visibility' field for each MMR, the visibility is controlled by a rule - either [$status]=1 or [$status]=0. This works well in theory; however, it does not work within the program. When I step through the scripting during debugging, the value of [$status] does change to 1 or 0 depending upon what actions the user chooses (just like it is supposed to) but this variable does not control the visibility of the MMR's.

Does anyone know why controlling the visibility of the MMR's in the manner described above does NOT work?
Thanks,
Daryl G
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Jul 2012
Posts: 71
Create hidden 'Flag (yes/no) field'.
In your script set it value to 1 or 0.
Use this flag field in visibility rule of MMR field.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Jul 2012
Location: Ireland
Posts: 480
Doing it the way MacHeuS said will work for sure as a field does refresh a state.

However, if you want to do it the way you wrote it originally, then you need to add a single line to your script that refreshes the field state.

See attached file for a working example.

Regards
James.
Attached Files
File Type: zip MyDBApp2.zip (32.8 KB, 7 views)
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Dec 2012
Location: Huntsville, AL
Posts: 256
James,
It now works PERFECTLY!!!! In my case, I had to add two 'Refresh' commands (one for each of the MMR's). There was nothing in the manual about using the 'Refresh' button - how do you figure out these tricks?
Thank you,
Daryl G
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Jul 2012
Location: Ireland
Posts: 480
Excellent, I'm delighted that works for you.

Quote:
There was nothing in the manual about using the 'Refresh' button - how do you figure out these tricks?
Your right. Seems that the manual says little to nothing about how this function works.

I use WinWedge a lot to get brilliant database to talk to machines in factories, so the refresh function is something I've had to use a lot.

Regards
James
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On