Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Default Values in Flex VBA

Status
Not open for further replies.

62chev

IS-IT--Management
Mar 4, 2004
56
US
I am new to using flexibility and am trying simplify data entry by setting several field values. The problem I run into is setting the value of fields that are not on the current tab. For example, when adding a new item master record I would like to set some of the values on tab 3 of this form. If I attempt to do this while tab 1 is displayed, I receive an error that I cannot set a field that does not have focus.

I don't see a way to move the fields from tab 3 to tab 1 and I would like to set these fields without forcing the user to go to tab 3.

Is there a way to:
1) move a Progression field from one tab to another?
2) a way to set the value of a field without actually navigating to the tab that contains that field and setting the focus on that field?

Just a note, for fields that have a static default value I am setting the default value in designer. The fields I need to default in Flexibility are ones that have their values determined based on other fields the user enters.

I appreciate any feedback or suggestions related to this.

Thank you!
 
You can move the fields from tab 3 to tab 1 by hiding them on tab 3 using the screen designer, then unhiding on tab 1. I am not a programmer, so I'll defer to Andy, Scott et al on the focus thing for Flex.
 
Thanks Macolahelp for explaining how hiding a field on one tab allows you to unhide it on another tab (like I said, I'm new to this, and the documentation is a bit sketchy).

I was able to set the focus on the fields I want to set on tab 3 by using setTab and setFocus. It looks a little strange since the screen flashes to the third tab then flashes back, but maybe that is unavoidable. If someone is aware of how this can be done and avoid the screen redisplay that would be great. If not, I will either live with the screen flash or move the fields to the first tab.

Thanks again for the help.
 
Sounds like you are a long ways to getting where you need to be. Moving the field to the front page will solve your issue of flashing. Is it you intention to not allow the user to update these fields. Perhaps if you describe what you are trying to accomplish I could be a bigger help.


Steve Henley
trianglepartners.com
Exact Software consulting, sales and implementations.
 
Another thought: you can also set defaults on many of the fields in screen designer or provide drop downs that limit the choices users have if you have some global considerations. Do you own screen designer? You would need flex, I imagine, if you want to set the values in other fields based on prior input.
 
It sounds like you are trying to make the reesponses conditional to what is selected in other fields, if that is the case then the screen designer strategy will not work.

Steve Henley
trianglepartners.com
Exact Software consulting, sales and implementations.
 
I am setting the defaults with designer on fields that have a static default value. I am using flex to default fields that have values based on other fields.

For example on tab 3 of item master I default order policy code and planning period with designer.

I use flex to default the manufacturing method and the buyer/planner since both of these have different values depending on whether the item is manufactured or purchased.

We have some folks (i.e. engineering staff) who are strongly opposed to doing "data entry" so I must make adding item numbers as painless as possible.

Thanks for all the feedback.
 
If this is only wanting to be done on the initial creation of a record, then I would suggest the following.

Flex may not be the tool to use for this as you have found one of the annoying restrictions of Flex.

If you are using MS-SQL as the backend, write a trigger for the addition of a record and summarily change the fields in question.

If Btrieve then a Work-around of the flashing screen, moving the fields, or using the got focus event to calc can be used. If the got focus is where you want to go then all the users will need to be educated to TAB through all the fields on a form to insure the "defaults" get calc'ed.

The best option here though is a trigger on the creation of the record.


The trigger method would not update the initial audit trail entries (if you use them) but is faster, not noticable to users, and will happen EVERY time you create a record.


Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
Thanks Andy for the input.

We are still using Pervasive (Btrieve), another reason for upgrading to SQL. I have held off upgrading since I am still not convinced it is worth spending any more money with Exact..... I won't go there.

Thanks again to everyone for their feedback!

Jim
 
Jim,

If you don't want to send the money to Exact, there are plenty of resellers on this board that will gladly help you out. This would at least minimize the $$$ Exact gets, if thats really an issue.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top