Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25
  1. #16
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741

    First, had to use Linked Table Manager to link your included BE. Then followed instructions, and no error occurred. I was able to do anything I wanted at the Stop. Then pressed F5 and code ran OK to End Sub. No errors at all.

  2. #17
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    What did you link to ? I added links to Disk and Tracks in Olist_BE then with the Stop highlit,I typed something under it and the error occurred.

  3. #18
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Click image for larger version. 

Name:	mmlink.png 
Views:	25 
Size:	20.4 KB 
ID:	51951

    Linked to mp3ListBE.mdb, because that's where the tables existed that ListTest.accdb was looking for. There were no tables defined in ListTest.accdb named Tracks or Disk.
    Last edited by davegri; 07-05-2024 at 11:41 PM. Reason: clarif

  4. #19
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    AFAIK both my tables are correctly linked. I can open and view them.
    So for you there is no error. Wow ! That wasn't expected.

  5. #20
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Quote Originally Posted by Middlemarch View Post
    AFAIK both my tables are correctly linked. I can open and view them.
    So for you there is no error. Wow ! That wasn't expected.
    Look at post#18. The tables shown are not Disks and Tracks, they are mp3Disks and mp3Tracks. All the queries expect those tables also. There are no tables named Disk or Tracks. Those two tables are in OList_BE.mdb. I don't know why you included that file in the Zip.
    The FE database is Listtest.accdb and it expects its BE to be mp3ListBE.mdb.

    If you linked the FE to tables DIsk and Tracks in OList_BE.mdb, and it runs at all, then you uploaded the wrong FE.

  6. #21
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    I linked to Disk and Tracks after your msg 16. The others were already linked and I thought that's what you meant. Now removed as they're
    opened instead in Module 1, Function MyCurrentDB. The name is selected in Frame68_Click
    It becomes the Target for data written to the linked tables.
    Is that how you see it ? (I'm not the best at descriptions!)

  7. #22
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    I've narrowed it down to the error occurring in this procedure. I think it has to do with both databases Listtest.accdb and OList_BE.mdb being open at the same time. The code so doing is obtuse (and not actually in the below procedure).

    Code:
    Private Sub btnImport_Click()
       DoCmd.OpenForm "frmImport", acNormal, , , , acDialog
    
    
        
      '  If UBound(OtherList) = 0 Then Exit Sub
        Dim Dat As Boolean
        Dim SourceFields As String
    
    
    
    
        Dat = AllFalse(OtherList)
        If Dat = True Then Exit Sub  'No Fields to copy selected
            
        Dim r As DAO.Recordset
        Dim ExtDB As DAO.Recordset
        Dim i As Integer
      
        SourceFields = "TTrack, Path, TrackNumber, TTitle, TPerformer, TComposer, Year, Mode, TNotes, Single, AlbumName, AlbumCat, AlbumTrack, Bitrate, Media, TDuration, FileSize"
        Select Case Split(OtherList(0), " ")(0)
    
    
            Case "Tracks"
                ThisList = Application.CurrentProject.Path & "\OList_BE.mdb"
    
    
        End Select
    
    
       ' if either of the below lines execute, the error occurs.
    '>>>>>
       'Set ExtDB = CurrentDb.OpenRecordset("SELECT " & SourceFields & " FROM Tracks IN " & Chr$(34) & ThisList & Chr$(34) & " Where Tcat = " & Split(OtherList(0), " ")(1) & " Order By tTrack;")
       'Set r = CurrentDb.OpenRecordset("Select TTrack, Path, [Take Number], TTitle, TPerformer, mComposer, Year, Mode, TNotes, TSingle, TLabel, AlbumCat, AlbumTrack, Bitrate, Media, TDuration, FileSize from mp3Tracks Where tCat = " & ThisDisk() & " Order By tTrack;")
    '>>>>>
       ' If r.RecordCount <> ExtDB.RecordCount Then MsgBox "Record counts are different, cannot Import": Exit Sub
       Stop
    End Sub

  8. #23
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    ListView-davegri-v01.zip

    See attached. Got rid of the code opening the Backend and added code to simply link the tables.
    Modified SQL code to accommodate the linked tables without having to specify the BE name.
    Added autoexec macro and its runcode, fcnStartup()
    Added code module modLinkTables
    Replaced a lot of existing code, with reasonably easy to understand code, with some comments

    Make sure Backends are in same folder as this Frontend. At BOJ, FE will link the 4 required tables from the 2 Backends.
    The error will not appear.
    Last edited by davegri; 07-06-2024 at 07:31 PM. Reason: clarif

  9. #24
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    Dave I don't see that in the db you uploaded . There's just a Form and a listview control.
    But you did get the error, my thinking was also the two recordsets were something to do with it but couldn't see how.
    Now even more confusion, as a test I linked to Olist and changed the recordset CD to a Database object. That worked.
    But as there's 3 other db's in the mix, that meant 6 linked tables and using my method (also tried IN in the swl) seemed more compact.
    Next I removed the links and reversed back to get the error again. But now it won't error as works as its should.
    So what to make of it all? A pity the error could not be defined. Be nice to know...
    I'd like to see what you did though,. Always intriguing to see how someone else does things, I'm self taught and know very little, an easily forget stuff at my age.

  10. #25
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Dave I don't see that in the db you uploaded . There's just a Form and a listview control.
    That was indeed the wrong DB. It was an earlier file concerning your request for help with the Listview ActiveX control back in February.
    Here is the correct FE.

    Listtest-davegri-v01.zip

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

Similar Threads

  1. Replies: 11
    Last Post: 09-10-2019, 03:10 PM
  2. Replies: 6
    Last Post: 08-08-2016, 06:42 AM
  3. Replies: 3
    Last Post: 06-10-2016, 06:07 AM
  4. Replies: 4
    Last Post: 01-15-2014, 01:00 PM
  5. Replies: 6
    Last Post: 11-15-2013, 07:01 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
  •  
Other Forums: Microsoft Office Forums