Hi,
I have created a form based on a query where the user can select the records (using a check box named Chk1 which is bound to a yes/no field in the Table) that he/she wants to have exported to a word template (with field codes). The user must be able to select several records and all of these should then be exported. I have the following code but it gives a compile error: end if without block if. Any help would be greatly appreciated, thank you in advance!
here is my code:
For Each ctl In Me.Controls
If Me.Chk1 = -1 Then
With doc
.FormFields("fldProjectName").Result = Me.ProjectName
.FormFields("fldProjectDetail").Result = Me.ProjectDetail
.FormFields("fldProjectEnd").Result = Me.ProjectEnd
.FormFields("fldCharlesRole").Result = Me.CharlesRole
End If
Next ctl
I have created a form based on a query where the user can select the records (using a check box named Chk1 which is bound to a yes/no field in the Table) that he/she wants to have exported to a word template (with field codes). The user must be able to select several records and all of these should then be exported. I have the following code but it gives a compile error: end if without block if. Any help would be greatly appreciated, thank you in advance!
here is my code:
For Each ctl In Me.Controls
If Me.Chk1 = -1 Then
With doc
.FormFields("fldProjectName").Result = Me.ProjectName
.FormFields("fldProjectDetail").Result = Me.ProjectDetail
.FormFields("fldProjectEnd").Result = Me.ProjectEnd
.FormFields("fldCharlesRole").Result = Me.CharlesRole
End If
Next ctl