Results 1 to 9 of 9
  1. #1
    Jeremy Sng is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Aug 2016
    Posts
    43

    How to create a search box in split form?

    Hi Everyone,



    I try lots of method to create a search box but i won't works.

    Anyone can help me?

    Thanks

  2. #2
    Jeremy Sng is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Aug 2016
    Posts
    43
    It*

    I search for Part number but there is a error on it. But i can't find where is the problem.

    Private Sub txtpartnumber_AfterUpdate()
    Dim strpn as String
    Dim strname as String

    Dim strname = Me.txtpartnumber.Value
    strpn = "SELECT" from (tblnike) "*"" (P/N ""*" txtpartnumber "*''")
    Me.RecordSource = strname

    End Sub

  3. #3
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    How to create a search box in split form?

    What do you want strpn to say?

    Select * from [tblnike] where [p/n] like * & txtpartnumber & *

    ??






    Sent from my iPhone using Tapatalk

  4. #4
    Jeremy Sng is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Aug 2016
    Posts
    43
    Hi Andy49,

    I want the strpn to search for part number of the shoe. But the program can't works.

    Any ideas where goes wrong?

    Thanks & Regards
    Jeremy Sng

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    I'm assuming your getting an error ? If so which line of vba code? I'd say initially use "select * from tblnike where [p/n] =1234" (assuming txtpartnumber is integer)

    By using a code you know you can check whether the program does as it should.

    Then alter the string to include txtpartnumber.


    Sent from my iPhone using Tapatalk

  6. #6
    Jeremy Sng is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Aug 2016
    Posts
    43
    hi andy,

    Can i check with you, is integer can replace by string. as my p/n is 1234-5678 (this p/n is consider string)?

    So i need to Dim strpn as String?

    eg my table as.

    nike new shoe p/n: 1234-5678
    puma new shoe p/n: 8765-4321

    And i able to search just the p/n all new show will out. But the program still won't works.

    Thanks and Regards
    Jeremy Sng

  7. #7
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Strpn is a string the way you have it set up

    dim strpn as string

    strpn = "SELECT * from [tblnike] where [P/N] = " & chr(34) & txtpartnumber & chr(34)

  8. #8
    Jeremy Sng is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Aug 2016
    Posts
    43
    Hi Andy,

    What does it mean by chr(34)?

  9. #9
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    It's an extra "


    Sent from my iPhone using Tapatalk

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

Similar Threads

  1. search form results into split form
    By murphy63 in forum Forms
    Replies: 4
    Last Post: 11-23-2016, 08:32 AM
  2. Search on Split-Form
    By Ekhart in forum Programming
    Replies: 8
    Last Post: 09-07-2016, 10:55 AM
  3. Replies: 1
    Last Post: 04-09-2015, 05:13 PM
  4. Replies: 3
    Last Post: 04-12-2014, 01:17 PM
  5. Replies: 5
    Last Post: 07-13-2012, 01:15 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