Question : Call main form refresh function

I have a main form that lists all the tasks assigned to a user. They select the task to work on and the task form opens. When they complete the task, I need to refresh the main form to show the tasks list minus the task they just completed.

On the task form, I use the following to refresh the main form:
Call Forms("crm_frm_Tasks_Assigned").SetFormRecordSource(lngEmplID)

SetFormRecordSource is a Public funtion on the main form that used by the main form on start up to show all tasks assigned to the employee id.

But when I attempt to call the main form fuction from the task form, I get the error:
Type mismatch 13

Any suggestions?

Answer : Call main form refresh function

The mismatch error is likely because the task form does not have a control lngEmplID and you're call the function with null, i.e. Call Forms("crm_frm_Tasks_Assigned").SetFormRecordSource(null).

If there's a control on the Main form called lngEmplID you can call this function with:

Call Forms("crm_frm_Tasks_Assigned").SetFormRecordSource(Forms!frm_Main!lngEmpID)
Random Solutions  
 
programming4us programming4us