Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

VBA To Move Through Recordset

  1. #16
    chalupabatman is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2016
    Posts
    114
    This line is causing my trouble I am getting a debug error of


    Code:
    Run-time error '3265'
    Item not found in this collection
    And here is my code

    Code:
    If Not (rs1.BOF And rs1.EOF) Then
        Me.txtfullinfo.Text = rs1![Information Systems].[MAC ID] & " - " & rs1![Information Systems].[Computer Name]
    End If

  2. #17
    chalupabatman is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2016
    Posts
    114
    Okay - I found my issue. It was the bracketing. It should read like this
    Code:
    Me.txtfullinfo.Text = rs1![Information Systems.MAC ID] & " - " & rs1![Information Systems.Computer Name]

  3. #18
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    5,514
    Can DLookup() concat multiple fields together? -- I was using a recordset as there is the potential that more than 1 row could be returned.
    You mean concat multiple records? Even if you have only one record, there can be multiple fields, so the number of records wouldn't matter because either way, the answer would be no. However, based on your answer to my questions, with one record and multiple fields where the control is in the header/footer, you'd concatenate from 2 separate controls (one for each field) into a 3rd control. If this is about 2 fields in the detail section, then as long as each record has a unique identifier, each control should have the correct data, thus the 3rd control should be correct for each record. But I don't think a DLookup for each record is the way to go, if that's what you're doing.

    It seems the more I read the fuzzier this gets. How can you open one recordset from 2 separate queries??
    Surely you can post a stripped down version with sensitive data removed?

  4. #19
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    5,514
    is this issue the same as what you posted here
    http://www.accessforums.net/showthread.php?t=75091

    In both cases, code is showing you want to concatenate about 3 values into one textbox with line wraps

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-11-2014, 10:26 AM
  2. Replies: 6
    Last Post: 12-03-2013, 10:14 PM
  3. How to Select second Recordset from first recordset
    By FrustratedAlso in forum Programming
    Replies: 28
    Last Post: 05-10-2012, 04:45 PM
  4. Replies: 2
    Last Post: 03-08-2012, 11:59 AM
  5. Replies: 1
    Last Post: 11-13-2009, 02:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums