Solved

How to edit columns in Combo Box based on user selection

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

695 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