Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / December 2004

Tip: Looking for answers? Try searching our database.

How do I update a cell in a table once exiting a Form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Adrian  Laboy - 30 Dec 2004 18:47 GMT
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 ????
Lynn Trapp - 30 Dec 2004 19:05 GMT
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]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.