Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2006, 07:23 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Visual basic update query

Private Sub CmdSaveRecord_Click()
    Dim strSql As String
    Dim StrKamer_nr As String, StrKamer_datum As String, StrKamer_tijd As String
    Dim StrKamer_roosterdatum As String, StrKamer_begintijd As String, StrKamer_eindtijd As String
    Dim StrMedewerker_nr As String, StrAssistent_nr As String, StrKamer_goedgekeurd As String, StrKamer_omschrijving As String

strSql = "UPDATE Kamers SET Kamer_roosterdatum = " & Me.Kamer_roosterdatum & ", Kamer_begintijd = '" & Me.Kamer_begintijd & "', Kamer_eindtijd = '" & Me.Kamer_eindtijd & "', Medewerker_nr = '" & Me.TxTMedewerker_nr & "', Assistent_nr = '" & Me.TxTAssistent_nr & "', Kamer_goedgekeurd = '" & Me.Kamer_goedgekeurd & "', Kamer_omschrijving = '" & Me.Kamer_omschrijving & "' WHERE Kamer_nr = '" & Me.Kamer_nr & "';"

strSql = "UPDATE Kamers SET Kamer_nr = StrKamer_nr, Kamer_roosterdatum = StrKamer_roosterdatum, Kamer_begintijd = StrKamer_begintijd, Kamer_eindtijd = StrKamer_eindtijd, Medewerker_nr = StrMedewerker_nr, Assistent_nr = StrAssistent_nr, Kamer_goedgekeurd = StrKamer_goedgekeurd, Kamer_omschrijving = StrKamer_omschrijving WHERE Kamer_nr = StrKamer_nr;"

    DoCmd.SetWarnings False
    DoCmd.RunSQL strSql
    DoCmd.SetWarnings True
End Sub

What's wrong wit my update insert into query?
Could someone look at it and fix it or give me some advise me

 
Old August 7th, 2006, 01:55 AM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you getting any error messages?

Since you only have:

DoCmd.RunSQL strSql

after the last strSql = "..." it is the only one being executed.

If you want the first to strSql sting to be executed, you need to inculde a

 DoCmd.RunSQL strSql

 after each one.



Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic monika.vasvani VB Databases Basics 5 June 16th, 2014 10:01 AM
visual basic 6.0 flowertear Pro VB 6 3 June 28th, 2013 03:16 PM
visual basic khandangoll Beginning VB 6 1 October 6th, 2006 04:05 PM
FTP in Visual Studio 2005 Pro (Visual Basic) shoopes VB How-To 1 June 29th, 2006 02:08 PM
Visual Basic 6.0 Danielvb VB How-To 1 June 9th, 2003 04:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.