Topic: Help with ComboBox in report

Hello
please could you help me solve this issue.
I have a ComboBox (employees)
I want to show a different employee names in the same report, but the report keep displaying the same name from ComboBox

Post's attachments

Attachment icon emp.JPG 22.74 kb, 116 downloads since 2022-03-21 

Re: Help with ComboBox in report

Please attach your project otherwise it's just guesswork.
Derek.

3 (edited by cmoi 2022-03-21 14:29:36)

Re: Help with ComboBox in report

Thank you for you interest Derek
this is a simple project (same idea) because the original one is so large
i want to show the selected employee name from the combo box in the report but the issue is (the final report display the same name even if i choose a different names from the combo box e.g : employee in = alpha ,employee out = omega)
sorry my English not so good i hope this is a clear explanation.

Post's attachments

Attachment icon combo box.rar 294.46 kb, 227 downloads since 2022-03-21 

Re: Help with ComboBox in report

Hi,
The problem is not with the report, it is with your data structure.
If you had shown both 'employee in' and 'employee out' in form1.tablegrid1, this would have been apparent.
To fix it, because you are using the employee combobox for two things ('employee in' and 'employee out'), you need to
1.  define a second relationship between the 'main' and the 'employee' table. 
2.  create a calculated field to hold the name of the employee from the second relationship.
3.  add the calculated field to your report selection.
Please see the attached.
Derek.

Post's attachments

Attachment icon combo box2.zip 337.76 kb, 246 downloads since 2022-03-21 

Re: Help with ComboBox in report

Hi Derek
thank you so much for help, I'm newbie (calculated field) and pascal programing.

6 (edited by cmoi 2022-03-22 11:24:30)

Re: Help with ComboBox in report

Hello
sorry for this, please bare with me
after I tried the Derek's solution I get this error

Post's attachments

Attachment icon Capture rep.JPG 18.29 kb, 116 downloads since 2022-03-22 

Re: Help with ComboBox in report

Hi,
Please attach the project.
Derek.

Re: Help with ComboBox in report

Thank you again Derek.
issue resolved, I had an error in the code

1000 thanx