I have a query that generates a list on a combobox. The list is stored in a table.
Table:
ID Used
IAS1 No
IAS2 No
IAS3 No
.
.
.
Once sombody selects one of the ID's I want the used cell to change from No to Yes....I tried the update command but for some reason it does not accept it. Can anyone help me ????
In the AfterUpdate event of your combobox you can try the following:
Private Sub Combo12_AfterUpdate()
Dim v_SQL As String
v_SQL = "Update tblCodes Set Used = ""Yes"" Where ID = """
v_SQL = v_SQL & Me.Combo12 & """"
DoCmd.RunSQL v_SQL
Me.Combo12.Requery
End Sub
Change the code above to reflect the actual name of your combobox.

Signature
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
"Adrian Laboy via AccessMonster.com" <forum@AccessMonster.com> wrote in
message news:94530fafb3bd47758c9c850d00fb99a9@AccessMonster.com...
> I have a query that generates a list on a combobox. The list is stored in a table.
> Table:
[quoted text clipped - 6 lines]
> .
> Once sombody selects one of the ID's I want the used cell to change from No to Yes....I tried the update command but for some reason it does not
accept it. Can anyone help me ????
Adrian Laboy - 30 Dec 2004 20:53 GMT
Thanks a lot....it worked....but when it tries to add the record it gives me a error:
It says that it can't update the record due to a type conversion failure.
The type of the field in the table is a Yes/No
And the value I'm entering is True........I also tried creating a boolean temp with a value of True.........but it did not work....any comments?
John Vinson - 31 Dec 2004 07:02 GMT
>It says that it can't update the record due to a type conversion failure.
Set it to -1 for True, 0 for False.
John W. Vinson[MVP]