Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2011
    Posts
    2

    Unanswered: Help required on Recordset AbsolutePosition

    Hello,
    I cannot seem to solve this problem,
    the following script works:
    Code:
    Debug.Print Me.Recordset.AbsolutePosition + 1#; [Colour]
    but this returns a compile error:
    Code:
    Dim strCol As String
    strCol = Me.Recordset.AbsolutePosition + 1#; [Colour]
    I can't see whhat I'm missing.

    Thanks

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    Dim strCol As String
    strCol = Me.Recordset.AbsolutePosition + 1#; [Colour]
    Change to:

    Code:
    Dim strCol As String
    strCol = (Me.Recordset.AbsolutePosition + 1#) & [Colour]
    If [Color] control value is a number and you would like to add that number to the .AbsolutePostion+1 value then change it as follows:

    Code:
    Dim strCol As String
    strCol = Me.Recordset.AbsolutePosition + 1# + [Colour]
    The output in strCol will be a String Value, in both instances.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  3. #3
    Join Date
    Oct 2011
    Posts
    2

    Solved

    Works just fine, Thanks for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •