Bound Column Change Not Working

squeakums

Well-known Member
I am using Bound Column 1 - which works fine, but if I want the Combo Box to use Column 3 to filter the form, it doesn't do anything?
 

Micron

Well-known Member
This looks like a variation of another of your posts? Regardless, I don't know what you expect to get in the way of an answer with so little information provided. Maybe post what you tried for applying a form filter based on column 3? Maybe you tried
Me.Filter = Me.myCombo.Column(3)
Me.FilterOn = True

??
 

Micron

Well-known Member
Depends, yes? If referring to the Column property, Column(0) is the first column. Column references are most often used in code. If referring to the BoundColumn property (usually set in the property sheet) the first column that contains data is 1. A setting of 0 for the BoundColumn property would refer to the list index, which is basically the row number. See https://docs.microsoft.com/en-us/office/vba/api/access.combobox.boundcolumn

As I said, so little information provided that I'm not going to speculate further on behalf of OP. There's no indication which is being referred to here, plus, I'm fairly certain OP posted this issue elsewhere, which means answers are being given there as well.
 

squeakums

Well-known Member
Thank you all for replying. I apologize that I did not provide much data. I wasn't sure what to provide. I'm building a Form, adding in a Combo Box - I'm pulling 3 fields in the Combo Box. Although, I moved it down to only 1 field, but it isn't searching/setting my form to that ID selected in the combo box. Does it happen to do with my primary key setup or how would I setup my form to filter to what is selected in my ComboBox?

For example, I'm selecting 49710 in my combo box, it has the same ID section in my Form, but it isn't changing to that Id number.

If I use a customer name, it will however filter to that name, but if I use the ID, will not change to that ID in the form selection. I have the ID setup as the primary key and not the customer name, along with a primary key that access assigned, so (2) keys are setup.

What is the best practice to setup a combo box to utilize it with a form to have it search for those (3) items used or even that (1) ID used? I feel like is some simple setting I'm missing. Please let me know what additional details you need. I would do a screen shot in here, but no idea how to add that..
 

squeakums

Well-known Member
Thank you all for replying. I apologize that I did not provide much data. I wasn't sure what to provide. I'm building a Form, adding in a Combo Box - I'm pulling 3 fields in the Combo Box. Although, I moved it down to only 1 field, but it isn't searching/setting my form to that ID selected in the combo box. Does it happen to do with my primary key setup or how would I setup my form to filter to what is selected in my ComboBox?

For example, I'm selecting 49710 in my combo box, it has the same ID section in my Form, but it isn't changing to that Id number.

If I use a customer name, it will however filter to that name, but if I use the ID, will not change to that ID in the form selection. I have the ID setup as the primary key and not the customer name, along with a primary key that access assigned, so (2) keys are setup.

What is the best practice to setup a combo box to utilize it with a form to have it search for those (3) items used or even that (1) ID used? I feel like is some simple setting I'm missing. Please let me know what additional details you need. I would do a screen shot in here, but no idea how to add that..
Actually, I figured this out on my own. Apparently, I did not have the correct MACRO written for the right field, I fixed it to link with the ID field instead of the name field and then changed the bound to column 2 (ID) field and it worked great. Hopefully, others can view this issue if necessary to resolve.
 

Some videos you may like

This Week's Hot Topics

  • Get External Data (long shot question!)
    This is likely a long shot but I am wondering if it is at all possible for Excel to somehow 'change' the contents of a URL that is being linked to...
  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • Cell Formatting
    Good Morning, I need to format a few different cells in the following manners: A1 has to always add a colon (:) after whatever is typed in by a...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • Workbook_Change stopped working !
    I am working on an app to speed up & automate processing of Credit Cards statements. After data is input from a CSV file, it is presented to the...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
Top