LinkChildFields and Datasheet Form

A

aubjf

I just wanna know if it is possible to set different LinkChildFields value
depending
of the value from a other field in the Datasheet form ? The following code
don’t work because the subform keep the last LinkChildFields value I set.:

Dim i, iCount As Integer
iCount = Me.Recordset.RecordCount

For i = 1 To iCount - 1

If Me.txtType = "Act" Then
Me.subPaieBon.LinkChildFields = "FKPaieAct"
End If

If Me.txtType = "Pub" Then
Me.subPaieBon.LinkChildFields = "FKPaiePub"
End If

If Me.txtType = "Mb" Then
Me.subPaieBon.LinkChildFields = "FKPaieMb"
End If

On Error GoTo err
RunCommand acCmdRecordsGoToNext

Next
err:

Thank in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top