Jump to content

Help refining go to field script


This topic is 7803 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I've got a little calendar database that I call with the click of a button that will allow me to select a date, then goes back to the original database and enters the selected date. I created a script that when you click a little icon, FM stores the field name and portal row in globals, opens the calendar, waits for the selection, then goes back, steps throught the fields until it gets to the one I was in when I clicked the icon and enters the date.

Problem: I have many date fields and you have to be in a field to set the current field. It's just not very elegant. You should be able to click the button and it knows you mean the date field it is next to.

Solution: Some smart FM type person can tell me how to select the field just left of the button using scripting.

Link to comment
Share on other sites

Instead of setting the global field with Status(CurrentFieldName) just set it (SetField(gFieldName, "DateField")! If you only have one button for multiple fields, use the Clairvoyance[] function to guess which field you want wink.gif" border="0.

-bd

Link to comment
Share on other sites

I have approxiamtely the same problem...28 date fields on each of 8 different layouts. I wanted to pop up a calendar when the user clicked into one of these date fields. The only solution I could come up with is separate scripts (224 one line scripts using SetField wired to the calendar popup). Pretty kludgy? You bet!!! I've tried to come up with a better solution but I can't. This probably doesn't make you feel any better, but misery loves company.

Link to comment
Share on other sites

Steve is correct. There is no way I know of to detect the cursor position. You'll need one script for each field. The field unique scripts can be short and all call a common subscript after they set a global to Status(CurrentField). You can use your current approach for the returned data, going to the next field and testing against the field name.

-bd

Link to comment
Share on other sites

Sorry, my FilterHumor[] function returned an error so I can't tell which part of your response was supposed to be funny. wink.gif" border="0

I have multiple date fields like datedue and dateentered inside a portal; so on one layout, I could have 25 possible date fields. Obviously, I don't want to write a script for each one. Also, I can just copy my button and put it anywhere which is pretty convenient since the script works as long as you push the button while the cursor is in a date field.

My script works but I was hoping I could capture the fieldname of the field next to each button by referencing the (x,y) location of the button and subtracting 1/8 inch or something like that. Goofy I know, but certainly plausible.

[ March 27, 2001: Message edited by: signal ]

Link to comment
Share on other sites

This topic is 7803 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.