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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hi all .. I have Table

Status
Not open for further replies.

jawadfrhad

Programmer
Sep 4, 2017
25
IQ
hi all ..
I have Table

Table shift
id name Daybreak morning sunset night
1 Ibrahim 1 0 0 0
2 Adam 0 0 1 1
3 Riyad 0 1 1 0
4 Othamn 1 1 1 0
======================================================================
I want to come up
======================================================================
Grid
name shfit date
dropDown To combo box : Ibrahim,Othamn Daybreak 01/01/2021
dropDown To combo box : Riyad,Othamn morning 01/01/2021
dropDown To combo box : Adam,Riyad,Othamn sunset 01/01/2021
dropDown To combo box :Adam night 01/01/2021
dropDown To combo box : Ibrahim,Othamn Daybreak 02/01/2021
dropDown To combo box : Riyad,Othamn morning 02/01/2021
dropDown To combo box : Adam,Riyad,Othamn sunset 02/01/2021
dropDown To combo box :Adam night 02/01/2021
dropDown To combo box : Ibrahim,Othamn Daybreak 03/01/2021
dropDown To combo box : Riyad,Othamn morning 03/01/2021
dropDown To combo box : Adam,Riyad,Othamn sunset 03/01/2021
dropDown To combo box :Adam night 03/01/2021
dropDown To combo box : Ibrahim,Othamn Daybreak 04/01/2021
dropDown To combo box : Riyad,Othamn morning 04/01/2021
dropDown To combo box : Adam,Riyad,Othamn sunset 04/01/2021
dropDown To combo box :Adam night 04/01/2021
dropDown To combo box : Ibrahim,Othamn Daybreak 05/01/2021
dropDown To combo box : Riyad,Othamn morning 05/01/2021
dropDown To combo box : Adam,Riyad,Othamn sunset 05/01/2021
dropDown To combo box :Adam night 05/01/2021

Thank for help
 
Interesting puzzle.

You would need to expand your initial cursor, and then process it (perhaps you could do both, I'm not sure), but before you can do that
you will need some kind of date in your existing shift table, unless you mean to predict the shifts going forward from any given date




Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Thank you for your response, GriffMG
I will clarify the question through pictures
Untitled_doieev.jpg


Untitled2_zwwf16.jpg

The second image is a grid in which the person’s name is entered and the dates come as a result of a code that I just made a combo box. How do different names appear with each line according to shift
thanks for the help
 
That helps.

What you need are multiple cursors for each shift, I'd create them with:

Code:
Select id, name FROM shift Where daybreak=1 into Cursor DaybreakShift
Select id, name FROM shift Where Morning=1 into Cursor MorningShift
* and so on

Then you can use multiple combos, one for each shift cursor and use DynamiccurrentControl to specify which one is used.

On the other side, things would work better with a usual normalization of the data.

Chriss
 
Thanks for the answer ...
I Attachment work but it has a problem ...I hope to solve it
when I work and put the values ​​of nameId in grid and then hover over them in the mouse, I find the values ​​change

Thank for you ......
 
 https://files.engineering.com/getfile.aspx?folder=168a47dd-9063-4ee3-8561-8323b2d0b3c2&file=New_folder_(4).rar
You can't have the cake and eat it.

You're resetting the combo1 items with each change to another cell. But there only is one combo for column3, with sparse=.f. it's drawn multiple times, but at any time you only have the records of the active row in it, so other rows lose their data.

Go back to what I suggested, you need several cursors for each shift to pick one name from them and keep them as they are. Then switch between the combos - each with its own cursor - by DynamicCurrentControl instead of requerying in just one combo.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top