Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 31st, 2006, 07:23 AM
Registered User
Join Date: Apr 2006
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old August 7th, 2006, 01:55 AM
Friend of Wrox
Join Date: Jul 2005
Location: Oklahoma City, OK, USA.
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts

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.

"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 03:31 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.