Results 1 to 2 of 2
  1. #1
    Eunice.harris is offline Novice
    Windows 7 32bit Access 2000
    Join Date
    Mar 2012
    Posts
    5

    Unhappy combo box in form suddenly not populating between 2 versions of my front end

    I have a form in Access 2000 with a combo box no longer populating. In the previous version of my front end, the combo box did populate, and I can't tell what the difference is.
    The form is called "frmEditCustomers". The only difference in the vb for the form is code for command boxes related to a list box in a different page of a tab control that is one level up from where my problem is.
    I have 1 combo box - "cboContractVehicleID", which does populate in both versions of my front end.
    The combo box in question is called "cboCVInstallations" and the record source is a query called ECCVInstalls, which references the first combo box, "cboContractVehicleID".

    The idea is once you update the first combo box, it requeries for the combo box that is causing trouble. Here is the code that is unchanged from my prior front end to my new front end:
    Code:
    Private Sub cboContractVehicleID_AfterUpdate()
    With Me
       .lblTemporaryHold.Visible = Not CBool(.cboContractVehicleID.Column(4))
       .txtTemporaryHoldDate.Visible = Not CBool(.cboContractVehicleID.Column(4))
       .cmdPlaceCVTemporaryHold.Visible = (CBool(.cboContractVehicleID.Column(4)) And (Not CBool(.cboContractVehicleID.Column(7))))
       .pgePredictedRemoval.Visible = Not CBool(.cboContractVehicleID.Column(7))
       .txtPredictedRemovalDate = Null
       .txtCalculatedAmount = Null
       .lblPayable.Visible = False
       .lblProrate.Visible = False
       -->>>> .cboCVInstallations = .cboContractVehicleID
       .cboCVRemovals = .cboContractVehicleID
       RequeryCVLists
       .tabCV.Visible = Not IsNull(.cboContractVehicleID)
       .lblSelectVehicleRequest.Visible = IsNull(.cboContractVehicleID)   
       .cmdChgLastMonDate.Visible = IsNull(.EndDate)
       If (gstrSecurityLevel = "A" Or gstrSecurityLevel = "AR") And Len(.cboCVRemovals.Column(1)) = 0 Then
          .cmdContractVehicleEdit.Visible = True
       Else
          .cmdContractVehicleEdit.Visible = False
       End If
    End With
    End Sub
    and
    Code:
    Private Sub RequeryCVLists()
    
    On Error GoTo Error_Handler
    
    With Me
       -->>>> .cboCVInstallations.Requery
       .cboCVRemovals.Requery
       .lstMonitoringHistory.Requery
       .lstLockOuts.Requery
    End With
    Exit_Error_Handler:
    Exit Sub
    
    Error_Handler:
    Select Case Err.Number
       Case INITIALIZE_GLOBALS_ERROR
          InitializeGlobals
          Resume
       Case Else
          MsgBox "Error " & Err.Number & " : " & Err.Description, vbExclamation, "Error!"
          Resume Exit_Error_Handler
    End Select
    
    End Sub
    The query sql for ECCVInstalls is, which is the record source for my combo box in trouble, cboCVInstallations, is the same in both front ends:
    SELECT tblContractVehicles.ContractVehicleID, tblContractVehicles.InstallDate, tblServiceCenters.ServCenter, Format([Serial],">") AS BAIID,
    Format([Rent],"Currency") AS Rnt, Format([Insurance],"Currency") AS Ins, GetTechnician([InstallTechID]) AS Tech,
    tblContractVehicles.ID110MailDate, tblDMVForms.FormId AS DL920Install, tblContractVehicles.DL920IssueDate, tblContractVehicles.DL920MailDate,
    tblContractVehicles.ID120InstallMailDate, tblDMVForms_1.FormId AS DL922Install, tblContractVehicles.DL922InstallMailDate, tblDMVForms_2.FormId AS
    DL924Install, tblContractVehicles.DL924IssueDT, tblContractVehicles.DL924IssueDT, tblVehicles.VIN, tblVehicles.License,
    tblContractVehicles.SlidingScale, tblContractVehicles.SlScaleFollowUpDate, tblContractVehicles.VehicleID, tblContractVehicles.MonitorFee AS
    PromoMonFee
    FROM ((tblDMVForms AS tblDMVForms_1 RIGHT JOIN (tblDMVForms RIGHT JOIN (tblServiceCenters RIGHT JOIN (tblBAIIDs RIGHT JOIN tblContractVehicles ON
    tblBAIIDs.BAIIDID = tblContractVehicles.BAIIDID) ON tblServiceCenters.SCID = tblContractVehicles.InstallSCID) ON tblDMVForms.DMVFormID =
    tblContractVehicles.DL920ID) ON tblDMVForms_1.DMVFormID = tblContractVehicles.DL922InstallID) LEFT JOIN tblDMVForms AS tblDMVForms_2 ON
    tblContractVehicles.DL924ID = tblDMVForms_2.DMVFormID) INNER JOIN tblVehicles ON tblContractVehicles.VehicleID = tblVehicles.VehicleID
    WHERE (((tblContractVehicles.ContractVehicleID)=CLng(Nz([Forms]![frmEditCustomers]![cboContractVehicleID],0))))
    ORDER BY tblContractVehicles.InstallDate;

    I know I have the same column listed twice in the SELECT: tblContractVehicles.DL924IssueDT. That didn't cause a problem in the one front end, worked fine with it there.

    I was actually trying to migrate my backend from Access 2000 to SQL Server Express 2008 R2. I then noticed this problem, that the combo box wasn't populating, but with the backend now in SQL Server, I actually got an error that said "Error 3146 : ODBC--call failed." Don't know if that's related, I got it on the same form called frmEditCustomers.
    Last edited by June7; 03-21-2012 at 06:39 PM. Reason: Mod Edit: add code tags and indentation

  2. #2
    cowboy is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2010
    Posts
    291
    With a query that big it will take some time to solve the problem. In
    Private Sub cboContractVehicleID_AfterUpdate() you have a line that just says RequeryCVLists, is that a Function? My suggestion would be to break it down, keep taking sections out and see if it is populating then another section and so on. If you can isolate the problem maybe I could help, but I dont want to go through your whole code :P

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo boxes on form not populating table
    By Madraykin in forum Access
    Replies: 12
    Last Post: 03-09-2012, 10:34 AM
  2. Replies: 12
    Last Post: 01-18-2012, 10:02 AM
  3. form is suddenly read-only
    By Karen H in forum Forms
    Replies: 28
    Last Post: 02-14-2011, 08:38 AM
  4. COMBO BOX Populating
    By b123 in forum Forms
    Replies: 14
    Last Post: 10-13-2010, 03:34 PM
  5. Populating other fields from combo box.
    By nkenney in forum Forms
    Replies: 1
    Last Post: 05-14-2009, 10:39 PM

Tags for this Thread

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