Solved

How to edit columns in Combo Box based on user selection

Posted on 2013-02-02
4
327 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

785 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