FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Table question
Table question
Débuté par John Marrone, 07 oct. 2004 16:10 - 3 réponses
Connectez-vous…
John Marrone
#1
Posté le 07 octobre 2004 - 16:10
Hi and help
I have a table that will only hold no more than 6 to 25 records at any one time. This table is linked to a query. Column 1 is a boolean value which displays a checkbox. Only one of these records can have a true value so only one record will have a check in the checkbox. Here's my question. I want to let the user click the checkbox on a record with out a check and at that moment set all the other records for this column to false and the one clicked on to true. So what I am doing is sort of like radio buttons. Only 1 record can have a true value for this field (column). Here is the code I am using but doesn't work.
vnCurRow is int
vnCurRow = CurrentSubscript()
HReadFirst(qryPPLines)
WHILE NOT HOut(qryPPLines)
qryPPLines.Selected = False
HReadNext(qryPPLines)
END
HReadFirst(qryPPLines)
HForward(qryPPLines,vnCurRow)
qryPPLines.Selected = True
TableDisplay(MySelf)
This is in the left mouse button up code.
Can someone please help. You would think this would me easy.
Thanks
John Marrone
Signaler
0
0
Stefan Bentvelsen
#2
Posté le 07 octobre 2004 - 17:24
Hello John,
don't you have to rewrite the records with HModify() after setting qryPPLines.Selected to False ?
Greetings, Stefan
Hi and help
I have a table that will only hold no more than 6 to 25 records at any one time. This table is linked to a query. Column 1 is a boolean value which displays a checkbox. Only one of these records can have a true value so only one record will have a check in the checkbox. Here's my question. I want to let the user click the checkbox on a record with out a check and at that moment set all the other records for this column to false and the one clicked on to true. So what I am doing is sort of like radio buttons. Only 1 record can have a true value for this field (column). Here is the code I am using but doesn't work.
vnCurRow is int
vnCurRow = CurrentSubscript()
HReadFirst(qryPPLines)
WHILE NOT HOut(qryPPLines)
qryPPLines.Selected = False
HReadNext(qryPPLines)
END
HReadFirst(qryPPLines)
HForward(qryPPLines,vnCurRow)
qryPPLines.Selected = True
TableDisplay(MySelf)
This is in the left mouse button up code.
Can someone please help. You would think this would me easy.
Thanks
John Marrone
Signaler
0
0
Bert
#3
Posté le 07 octobre 2004 - 17:47
Hi John,
If the checkbox is the only entry field in the table.
In the row entry code point:
i is int
FOR i = 1 TO TableCount(Table1)
Column1[i]=False
END
MySelf=True
I'm sure there are better ways to do it but I am drawing a blank.
HTH
Bert
Hi and help
I have a table that will only hold no more than 6 to 25 records at any one time. This table is linked to a query. Column 1 is a boolean value which displays a checkbox. Only one of these records can have a true value so only one record will have a check in the checkbox. Here's my question. I want to let the user click the checkbox on a record with out a check and at that moment set all the other records for this column to false and the one clicked on to true. So what I am doing is sort of like radio buttons. Only 1 record can have a true value for this field (column). Here is the code I am using but doesn't work.
vnCurRow is int
vnCurRow = CurrentSubscript()
HReadFirst(qryPPLines)
WHILE NOT HOut(qryPPLines)
qryPPLines.Selected = False
HReadNext(qryPPLines)
END
HReadFirst(qryPPLines)
HForward(qryPPLines,vnCurRow)
qryPPLines.Selected = True
TableDisplay(MySelf)
This is in the left mouse button up code.
Can someone please help. You would think this would me easy.
Thanks
John Marrone
Signaler
0
0
John Marrone
#4
Posté le 07 octobre 2004 - 19:12
Hi Seafan
Your right and also you need to create the query with the "hQueryDefault + hModifyFile" parameter. But thanks for pointing me in the right direction. I had gone to a part of my program where I wasn't dealing with querys for a while and just forgot to give myself the right to change a querys records.
Thanks
John
Hello John,
don't you have to rewrite the records with HModify() after setting qryPPLines.Selected to False ?
Greetings, Stefan
Hi and help
I have a table that will only hold no more than 6 to 25 records at any one time. This table is linked to a query. Column 1 is a boolean value which displays a checkbox. Only one of these records can have a true value so only one record will have a check in the checkbox. Here's my question. I want to let the user click the checkbox on a record with out a check and at that moment set all the other records for this column to false and the one clicked on to true. So what I am doing is sort of like radio buttons. Only 1 record can have a true value for this field (column). Here is the code I am using but doesn't work.
vnCurRow is int
vnCurRow = CurrentSubscript()
HReadFirst(qryPPLines)
WHILE NOT HOut(qryPPLines)
qryPPLines.Selected = False
HReadNext(qryPPLines)
END
HReadFirst(qryPPLines)
HForward(qryPPLines,vnCurRow)
qryPPLines.Selected = True
TableDisplay(MySelf)
This is in the left mouse button up code.
Can someone please help. You would think this would me easy.
Thanks
John Marrone
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte