How to refer to the 2nd record of a subform ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I want to make an If ..Then code: "If (the number of the current record in
the subform is the second record) Then DoCmd. (action),
but I just can't find the right syntax.
Can anybody please tell me how to do this ?
 
eric said:
I want to make an If ..Then code: "If (the number of the current record in
the subform is the second record) Then DoCmd. (action),
but I just can't find the right syntax.


I think this might do it:

If Me.Recordset.AbsolutePosition = 1 Then
 
Hi Marshall,
Thank you very much for responding, and YES... it works !
Now the first part of my code looks like this:

If Me.sfrmSubform.Form.Recordset.AbsolutePosition = 1 Then .....

In this code dots are used to for seperation.
Earlier I saw a downloadpage with all kinds of syntax for main/subform
were in some cases also the exclamation sign " ! " is used.
Can you tell me if there is a rule where or when to use " . " or " ! "
or perhaps can you direct me to a tutorial spot where I can learn about this
specific issue ?

greetings
 
eric said:
Thank you very much for responding, and YES... it works !
Now the first part of my code looks like this:

If Me.sfrmSubform.Form.Recordset.AbsolutePosition = 1 Then .....

In this code dots are used to for seperation.
Earlier I saw a downloadpage with all kinds of syntax for main/subform
were in some cases also the exclamation sign " ! " is used.
Can you tell me if there is a rule where or when to use " . " or " ! "
or perhaps can you direct me to a tutorial spot where I can learn about this
specific issue ?


Here's a link to an excellent reply to that question by Dirk
Goldgar:
http://www.ureader.com/message/1345587.aspx
 
Back
Top