Results 1 to 3 of 3
  1. #1
    beerdini is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2021
    Posts
    3

    Combobox value to table

    I'm about 20 years out from when I last did any development with Access and trying to keep a long story short, I'm trying to import data from a web filter that I inherited that has decades of people doing stuff with it, in order to identify and clean up redundant and no longer relevant rules, and given the tools that I have, Access is better than trying to do this by spreadsheet. I might be trying to run before I can walk here but in college my experience is using a relational database model.

    I am making a form that currently has 2 combo boxes, 1 text box and an "enter" button. Here is what I have so far:

    Combo1 - IP address table
    PK - hidden
    IP address 1 - visible
    IP address 2 - hidden but displayed in the text box mentioned above.

    Combo2 - Policy name table
    PK - hidden
    Policy name - visible



    When I click the "enter" button I want the 2 PK values to be written to a 3rd table that will only contain the PK values of the associated IP and Policy in each row, but so far I'm not getting anything to populate. My latest attempt I defined 2 integer variables that on Click I have them set for "variable = Me![cbo].Column(#)". Then I have a couple of strings to build out a string "INSERT INTO tblJoin (IPID,PolicyID) VALUES (variable1,variable2)" followed by execution of that string. Again my join table remains empty.

    If I can get this figured out I have several similar joinings that I am planning to perform and my ultimate goal is to expand the logic so I can prompt myself to enter an IP address and it will search all of the policies, exceptions, etc... that I am associating and show me everything that is associated with that IP, because the vendor product doesn't have an easy way to do this. I also plan to expand it to add and search by URL to find all of my rules where a URL is entered so I can try to clean up and consolidate redundant rules, but babysteps.

    How can I write these hidden values from the comboboxes to this third table? Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,820
    Post your actual procedure code. Or provide db for analysis, follow instructions at bottom of my post.

    What command are you using to execute the INSERT? Most likely you need to concatenate the variables.

    "INSERT INTO tblJoin (IPID,PolicyID) VALUES (" & variable1 & ", " & variable2 & ")"

    Review https://stackoverflow.com/questions/...crosoft-access
    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.

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Did you ensure that the variables actually have values?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Combobox in Table subdatasheet
    By zburns in forum Access
    Replies: 2
    Last Post: 02-21-2020, 09:11 AM
  2. Replies: 1
    Last Post: 05-24-2014, 09:08 AM
  3. Replies: 1
    Last Post: 04-26-2013, 05:30 PM
  4. ComboBox Keeps updating Table
    By Garito100 in forum Forms
    Replies: 15
    Last Post: 02-20-2012, 11:29 AM
  5. Combobox and table interference
    By t_dot in forum Access
    Replies: 2
    Last Post: 08-12-2010, 07:04 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