Form with Subform

zulq
Member Posts: 204
Hi,
Created a form and a subform but having problems basing selections on the first form.
The first form contains text fields for employer No. and date received and a command button. Employer No. is chosen from the customer table and date received is to be typed.
It also has command button.
Now my problem I want when a user choose an employer/customer on the form and press the command button the subform to automatically select all employees for the employer/customer chosen.
Please help, have no ideas as how to achieve this...
Any ideas welcome please.
Created a form and a subform but having problems basing selections on the first form.
The first form contains text fields for employer No. and date received and a command button. Employer No. is chosen from the customer table and date received is to be typed.
It also has command button.
Now my problem I want when a user choose an employer/customer on the form and press the command button the subform to automatically select all employees for the employer/customer chosen.
Please help, have no ideas as how to achieve this...
Any ideas welcome please.
Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?
0
Answers
-
put a function on the subform that takes the wanted filters as a parrameter.
in this function you use filters on the subforms rec var.
In the parrent form you can call the funtion using currform.replacethispartwithsubformname.function(parameters).
should do the trick**********************
** SI ** Bert Van Gestel **
**********************0 -
Hi Bgestel,
Please excuse for being a novice in navision but have never programmed such a function before and not a trained developer yet.
Below is the code I've being trying to modify:"Populate(EmployerNo)"(); RESET; Employee.SETRANGE("Employer No.",'NPF/20805'); IF Employee.FIND('-') THEN BEGIN REPEAT TmpItem."Employee No." := Employee."No."; TmpItem."Full Name" := Employee."First Name"; TmpItem.COPY(Rec); UNTIL Employee.NEXT=0; END;
Please let me know where am wrong or if this is totally the wrong way.
Also when I push the command button I get an error:
there is insufficient memory (stack) to execute this function
Once again let me explain exactly what I want. I want an employer is selected in the main form and the button is clicked the function to return all the employees of the chosen employer to the subform which I based on a temporal table variable.
Help please need this urgently!
](*,) ](*,) ](*,)Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?0 -
I dont know why you need this thing..
You can put subfomlink property, depends upon the employee seelcted its automatically filter the records.
Thank youJAYESH PATEL0 -
Jayesh,
I don't think you read the post properly. Please do read properly before posting as such postings will discourage others from trying to help in solving the problem. Its not as simple as you thinking and please once again read it properly before replying.
Once again, I want a subform based on a temporal table to be automatically filled in with all the employees and their details of a chosen employer.
For example if it was a report you would have employer, and employee indented by 1 and thus when user choose an employer all employees of the chosen employer will be shown on the report.
If your post is referring to the same solution please elaborate how to achieve this else let others try.
Thanks.Few years ago we were not existing and few years to come we would be in the grave! So what will benefit us in the grave?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions