Docmd runsql not updating Sex boy paka

The Const, QTE, is helpful as it make the job of getting the right number of Quotes more simple (at least for me). File Nbr Suf Fx FROM tbl Complaints WHERE (((tbl Complaints.

These include Delete Queries (used to delete records from a table), Append Queries (used to add records to a table), Update Queries (used to edit records in a table) and Make Table Queries (used to create a new table).

Working from the Access query design window you are limited to the four query types described above, but using SQL in conjunction with VBA (or by entering SQL directly into the SQL view of the Access query design window) you can accomplish a lot more, including the use of "data-definition queries" which are used to build and modify the structure of the database itself.

The problem you are having is a classic SQL-101 problem.

How can i pass the string value to the SQL command and bypassing the pop up window? Z For openers, repeatedly asking the same question will tend to create more annoyance than sympathy.

The task that i'm trying to complete is to update a field (eg time field) based on the ID given by the user (button click) if the field is empty. For example, if the information is inserted after the Do Cmd. Because if the SQL will use the conditional by using its SQL syntax, for example WHERE, AND etc.. But, is it a BOOLEAN result for the Do Cmd.update Sql? I would like to use like below for the conditional updating the database..

So, can the SQL syntax being used in conditional update or i still have to use MAOL? Rgds CN The problem is in the way you are attempting to create the SQL statement. Textupdate SQL = "UPDATE Att ([Time In]) WHERE ( [Stdnt ID] = '" & Stdnt ID & "'') AND ([Time In] =" "& & ''") I'm not exactly sure but I think you are trying to update the ATT table and set the [Time In] column to something but you aren't specifying what that should be, although you DO appeare to be trying to constrain the selection of what to update. What I think you need is: update SQL = "UPDATE Att SET [Time In] = WHERE ( [Stdnt ID] = '" & Stdnt ID & "') OR ([Time In] IS NULL)" Respectfully, Ralph D. Programmer Analyst SWBC 9311 San Pedro Ave., Suite 600 San Antonio, TX 78216 (800) 527-0066 x7368 - Toll Free (210) 321-7368 - Direct (210) 387-7744 - Mobile Visit our website at com" id="ctl00_m_m_i_ctl00_gr_ctl01_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="3172680" / Chena, The problem is in the way you are attempting to create the SQL statement. Textupdate SQL = "UPDATE Att ([Time In]) WHERE ( [Stdnt ID] = '" & Stdnt ID & "'') AND ([Time In] =" "& & ''") I'm not exactly sure but I think you are trying to update the ATT table and set the [Time In] column to something but you aren't specifying what that should be, although you DO appeare to be trying to constrain the selection of what to update. What I think you need is: update SQL = "UPDATE Att SET [Time In] = WHERE ( [Stdnt ID] = '" & Stdnt ID & "') OR ([Time In] IS NULL)" Respectfully, Ralph D. Programmer Analyst SWBC 9311 San Pedro Ave., Suite 600 San Antonio, TX 78216 (800) 527-0066 x7368 - Toll Free (210) 321-7368 - Direct (210) 387-7744 - Mobile Visit our website at com however I would start with something in SQL get this working and sort out the logic then trnaspose this to access so on SQL the syntax would be UDPATE tablename set field = '' where field2 = 'test' get all your logic in here and post back then you need to do some 'clever' stuff to get this to work in access." id="ctl00_m_m_i_ctl00_gr_ctl03_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="3172689" / Yes you can, however I would start with something in SQL get this working and sort out the logic then trnaspose this to access so on SQL the syntax would be UDPATE tablename set field = '' where field2 = 'test' get all your logic in here and post back then you need to do some 'clever' stuff to get this to work in access. I just want to make the email as short as possible Anyway it worked after i tested with the database with a simple tweak based on the requirement. Run Sql = TRUE Then Else Is it correct what I'm thinking? Thanks Best Rgds CN" id="ctl00_m_m_i_ctl00_gr_ctl07_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="3175393" / Hi ralph, ALun Thanks for the help. Sorry for the brief syntax because i want to make it as simple as it can. This is the part that i'm looking to put for the IF and ELSE statement. Run Sql is executed, will it turn to TRUE so i can proceed with IF ELSE statement as the Idea as below. I means is it can be TRUE or FALSE condition where i can use this for IF ELSE statement? For example, if the information is inserted after the Do Cmd. Because if the SQL will use the conditional by using its SQL syntax, for example WHERE, AND etc.. i tot test already contained a string value name1 but it didn't.. Run SQL INSERT INTO atttable[(studntname)] VALUES (test) . When i run the syntax, another window pop up asking me to put the parameter for test..In order to get the proper results, you need to create the entire SQL statement as a string and then execute that string: somestring = "INSERT INTO atttable (studntname) VALUES (" & test & ")" Now, execute the contents of that string (i.e. Len Robichaud IT Manager Visual Comfort 713-686-59 [email protected]" id="ctl00_m_m_i_ctl00_gr_ctl05_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbody Id="3164642" / Here is how I handle these: Const QTE = """" Dim test as string Dim str SQL as string Test = "Name1" str Sql = "INSERT INTO atttable[(studntname)] VALUES " & QTE & Test & QTE Do Cmd.

Comments are closed.