how to use the slider and a database?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
how to use the slider and a database?
I want to grab the value of a "slider" and put it into a database. I have looked through the docs and find only minimal references to the "Slider" control.
Any help is greatly appreciated
Jeff
Any help is greatly appreciated
Jeff
Jeff G potts
Re: how to use the slider and a database?
Hi Jeff,
you are looking for "thumbposition" and "scrollbar"
Abbreviations (lazy me): thumbpos and sb
Getting:
...
put the thumbpos of sb "your scrollbar here" into tValueToStore
...
Setting:
...
set the thumbpos of sb "your scrollbar here" into tStoredValue
...
Best
Klaus
you are looking for "thumbposition" and "scrollbar"

Abbreviations (lazy me): thumbpos and sb
Getting:
...
put the thumbpos of sb "your scrollbar here" into tValueToStore
...
Setting:
...
set the thumbpos of sb "your scrollbar here" into tStoredValue
...
Best
Klaus
Re: how to use the slider and a database?
a slider, with the value in a field.jpottsx1 wrote:I want to grab the value of a "slider" and put it into a database. I have looked through the docs and find only minimal references to the "Slider" control.
Once you're able to get the value of the slider, then after it's not a problem to write it to a database.
- Attachments
-
- SB.zip
- (484 Bytes) Downloaded 362 times
Re: how to use the slider and a database?
Thanks for the direction, but I've encountered a new snag.
When I use the following code;
Jeff
When I use the following code;
I genererate new entries whenever I drag the mouse over the card, not just when I move the slider. Any ideas on this?on scrollbardrag
put the thumbpos of sb "mysb" into pTaskName
put "INSERT into tasks (task) VALUES ('" & pTaskName & "')" into tSQL
revExecuteSQL sDatabaseID, tSQL
## Refresh the task list
showTasks
end scrollbardrag
Jeff
Jeff G potts
Re: how to use the slider and a database?
Very strange !jpottsx1 wrote: I genererate new entries whenever I drag the mouse over the card, not just when I move the slider. Any ideas on this?
You put this script into the scrollbar "mysb", right ? Or in the card ? I guess you might have another scrollbar on the card ?
What about sDatabaseID, you put a "global sDatabaseID" within the script ?
Re: how to use the slider and a database?
I had the script on the card and it was causing the problem.
I fixed the problem with putting the following code;
on mouseup
put the thumbpos of sb "mysb" into pTaskName
end mouseup
for the slider, then I put the following code in the button to create a record;
on mouseUp
put "INSERT into tasks (task) VALUES ('" & pTaskName & "')" into tSQL
revExecuteSQL sDatabaseID, tSQL
## Refresh the task list
showTasks
end mouseUp
All works fine now, thanks for the help.
I fixed the problem with putting the following code;
on mouseup
put the thumbpos of sb "mysb" into pTaskName
end mouseup
for the slider, then I put the following code in the button to create a record;
on mouseUp
put "INSERT into tasks (task) VALUES ('" & pTaskName & "')" into tSQL
revExecuteSQL sDatabaseID, tSQL
## Refresh the task list
showTasks
end mouseUp
All works fine now, thanks for the help.
Jeff G potts