Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2005
    Posts
    55

    Question Unanswered: Listbox- Subform

    I have an unbound listbox with which i want to populate a subform using the listbox doubleclick function. I am using this code

    Me.subInfringements.Form.RecordSource = "SELECT qryInfringements.Rego, qryInfringements.OffenceDate, qryInfringements.OffenceTime, qryInfringements.InfringementNumber, qryInfringements.ObligationNumber, qryInfringements.Location, qryInfringements.InfringementInfo, qryInfringements.DateDriverInformed, qryInfringements.DateInfoFaxedToAuthority, qryInfringements.DriverNominated, qryInfringements.InfringementAmountExGst, qryInfringements.Email, qryInfringements.DOB, qryInfringements.LicenceNo, qryInfringements.State, qryInfringements.InfringementID FROM qryInfringements WHERE qryInfringements.infringementID = lstInfringements.Column(0);"

    This returns the error Undefined function lstInfringements.Column in expression


    Not sure what the problem is , i know for certain that lstInfringements.Column (0) is in fact the infringementID field, any suggestions?

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Databaseman
    any suggestions?
    Yup. Concatenate the value of lstInfringements.Column(0) into the string rather than the text lstInfringements.Column(0).
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Mar 2005
    Posts
    55
    Can you please explain what you mean?

    if you mean that i shoudl create a variable assign the value of the listbox to it then attach the varaible to the select statement, then i have tried. The problem was that the select query gets activated before the varaible is assigned the value, i know i can resolve this by including a pause in the code, however there has to be a better way.

    If you can please post the code that i shoudl use

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Code:
    .....
    FROM qryInfringements WHERE qryInfringements.infringementID = " & lstInfringements.Column(0)
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Mar 2005
    Posts
    55
    Thanks for that, it worked perfectly

Posting Permissions

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