Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    160

    Unanswered: Opening a form for a specific record

    Hi! I have form that consists of combobox,listbox, and option group. If I select one of the technician from the combobox, listbox will show up the customers for that technician, which is build from a query. If I double click on one of the customers "lastname" field in the list box I want to open a form(Order Details Subform1) for that specific record.

    Code:

    Private Sub List7_DblClick(Cancel As Integer)
    DoCmd.OpenForm "Order Details Subform1", acNormal, , "Lastname = Me!List7!Lastname"
    End Sub

    With this code I am getting "Order Details Subform1" with nothing.

    Any Help

    Thanks
    Vad

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Change this:

    "Lastname = Me!List7!Lastname"

    to this:

    "Lastname = " & Me!List7!Lastname

  3. #3
    Join Date
    Aug 2003
    Posts
    160

    Opening a form for a specific record

    Change this:

    "Lastname = Me!List7!Lastname"

    to this:

    "Lastname = " & Me!List7!Lastname

    What is the difference between those two, could you explain for me.

    Thanks
    Vad

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: Opening a form for a specific record

    Originally posted by vad
    Change this:

    "Lastname = Me!List7!Lastname"

    to this:

    "Lastname = " & Me!List7!Lastname

    What is the difference between those two, could you explain for me.

    Thanks

    "Lastname = Me!List7!Lastname"
    Access will recognise it as a string

    but

    "Lastname = " & Me!List7!Lastname
    Access will recognise it as a string and a variable

Posting Permissions

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