Results 1 to 4 of 4
  1. #1
    mikael is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    24

    Forms - Select record in list box and open form populated with that record

    for search form, i have textbox as a user input, n list box to filter the record..


    what i really want is to double click the highlighted record to display full record which in other form.. here is the code

    Code:
      
        Dim stDocName As String    Dim stLinkCriteria As String
    
    
        stDocName = "USER"
        
        stLinkCriteria = "[Service Tag]=" & Me![search]
        DoCmd.OpenForm stDocName, , , stLinkCriteria
    however, the code run to be error at stLinkCriteria..
    i dont know how to configure the problem since i just copied the code from my research.
    or do i have another way so i can display the selected record from listbox.. anyone pls help me.

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Is [Service Tag] numeric or text? What's the error?

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    If it's popping an Error on

    stLinkCriteria = "[Service Tag]=" & Me![search]

    which uses the correct syntax if [Service Tag] is defined as a Number Datatype, one has to assume, given its name, that it is actually a Text Datatype, in which case the correct syntax would be

    stLinkCriteria = "[Service Tag]='" & Me![search] &"'"

    although you don't need the Square Brackets around Search, and I'd probably write it simply as

    stLinkCriteria = "[Service Tag]='" & Me.search &"'"

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    mikael is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    24
    thanks Missinglinq.. it help much...

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

Similar Threads

  1. select Subform record and go to record on form
    By pcool in forum Programming
    Replies: 6
    Last Post: 04-16-2012, 05:50 PM
  2. How to jump on a new record when forms open?
    By braveali in forum Programming
    Replies: 3
    Last Post: 02-21-2012, 08:17 AM
  3. Replies: 5
    Last Post: 10-28-2011, 02:42 PM
  4. Replies: 9
    Last Post: 09-16-2011, 03:52 PM
  5. If record does not exist, open add new record form
    By RobertIngles in forum Programming
    Replies: 2
    Last Post: 02-01-2011, 08:47 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