Normal Topic Change Field Type (Read 689 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Change Field Type
Oct 30th, 2012 at 5:53pm
Print Post Print Post  
Hi -

Can I change an element from a date field to a static text button?
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Change Field Type
Reply #1 - Oct 31st, 2012 at 1:00am
Print Post Print Post  
Do you mean a static text element, or a command button? Actually, it doesn't matter because neither of these can be bound to a field.

Maybe you mean that you want to display the date from a (hidden) date field on a command button? That can be done. If that's what you want, you would use something like the following.
Code
Select All
Label(MyCommandButton, @AsFormattedByLE(MyDateLE, 1, "")) 



The Label command is how you change the text on a command button (or a static text LE), and the @AsFormattedByLE command formats it the same as the date LE that we are getting the date from. Without the @AsFormattedByLE part, you would end up with a date that looks like "2012/10/30".

If that's not what you are looking for, please explain more about what you are trying to do.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Change Field Type
Reply #2 - Oct 31st, 2012 at 5:35am
Print Post Print Post  
Carl -

Sorry that I wasn't clear.  I wanted to change a "date" field to a "command button."

In other words, when looking at the property view I wanted to changed the "Bound to Type" from "Date" to "Static_Push_Button"

I had to get it done so I simply deleted the original elements and added a new ones.

It would have been easier if I could have just changed the "type" the way I can go to Manage Fields and Change the Field type from (for example) "date" to "keyword" etc.

  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Change Field Type
Reply #3 - Oct 31st, 2012 at 6:29pm
Print Post Print Post  
A date field and a text box that is bound to a date field are not the same thing. I'm assuming it's the text box that you wanted to change into a command button.

Deleting an element and creating a new one of a different type that is bound to the same underlying field is the correct way to do that. For example, replacing a text box with a combo box.

Since a command button cannot display the dates in the date element, we're not sure what you are trying to accomplish by changing a text box that displays dates into a command button. Hence the confusion about answering your question.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged