Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to edit columns in Combo Box based on user selection

Posted on 2013-02-02
4
Medium Priority
?
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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 31

Expert Comment

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

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 66

Author Closing Comment

by:Jim Horn
ID: 38852647
Thanks.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

610 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