Results 1 to 2 of 2
  1. #1
    hawke is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    1

    Sql codes

    Hi all

    i am new to access and have never done any programming ect

    i am trying to create a search form using 3 combo box to filter records in a sub box.

    my goal is to be able to select a cable gland type from a drop down box. then select the size of the gland from a second box (a - h) and finally in the 3rd box select the thread size of the gland. once all 3 boxes are filled in in the sub form id like the full record of that particular gland with information like the certification and application

    i have been following a tutorial on youtube calledAccess: How to Create Search Form Using Combo box Part 1
    https://www.youtube.com/watch?v=8N1hRBdsI1s


    but when it comes to the sql code i cannot get it to work

    my code is as followed

    Private Sub bombobox1_AfterUpdate()
    Dim glandname As String
    glandname = "select * from GLANDS where ([GLAND] = " & Me.bombobox1 & ")"
    Me.glandsub1.Form.RecordSource = glandname
    Me.glandsub1.Form.Requery
    End Sub


    a quick break down of the tables ect

    GLANDS is my table containing gland names sizes thread and certification
    GLAND is the field containing 5 different glands
    bombox1 is the combo box im trying to use as the first drop down menu
    glandsub1 is the sub form in the search form i am creating



    when i run the code i get no errors until i select an item from the combo box
    from there i get various different error codes


    i have attached a pdf containing print screens of my database
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Suggest you review this http://www.allenbrowne.com/ser-62.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Is there an error with my import codes?
    By hclifford in forum Import/Export Data
    Replies: 6
    Last Post: 12-08-2014, 10:22 AM
  2. Access Codes
    By Probie in forum Code Repository
    Replies: 3
    Last Post: 06-04-2013, 01:18 PM
  3. Inventory with Bar Codes
    By theperson in forum Access
    Replies: 2
    Last Post: 06-02-2013, 08:27 PM
  4. Queries and codes
    By alliandrina in forum Queries
    Replies: 2
    Last Post: 05-03-2012, 05:53 PM
  5. Zip Codes
    By Laurie B. in forum Access
    Replies: 6
    Last Post: 02-25-2011, 02:38 PM

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