Solved

How to edit columns in Combo Box based on user selection

Posted on 2013-02-02
4
336 Views
Last Modified: 2013-02-04
Hi All

I have a three-column combo box, the first two columns are visible, and the third is an invisible Boolean field.

I would like to write VBA code in the combo box's AfterUpdate event that for whatever record the user selects, for the hidden column the selected row value is True, and all other row values to False.

Thanks in advance.
Jim
0
Comment
Question by:Jim Horn
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38847661
try something like this

private sub combo0_afterUpdate()

usql = "update table1 set selected=-1 where id=" & me.combo0
currentdb.execute usql

usql = "update table1 set selected=-1 where id<>" & me.combo0
currentdb.execute usql


end sub

selected is the third cp;umn of your combo, id is the bound column of the combo
0
 
LVL 30

Expert Comment

by:hnasr
ID: 38847873
What is the Row source type of the combo?
0
 
LVL 65

Author Comment

by:Jim Horn
ID: 38850834
>What is the Row source type of the combo?
It's a query that's based on a SQL linked table.
 
I'll go with Cap's answer unless I hear otherwise, as I was favoring an answer that manipulated the combo box via VBA, to avoid any second-combo-box-dropdown refresh issues, but I suppose refreshing after the above SQL calls wouldn't be that big of a deal.
0
 
LVL 65

Author Closing Comment

by:Jim Horn
ID: 38852647
Thanks.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question