Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 17th, 2003, 09:01 AM
fule fule is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 fule User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what is wrong with this code ????

Hi All,

What is wrong with this code :
------------------------ Start ------------------------------
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click

If IsNull(Me.cmbShip) Then
MsgBox "Please select vessel "
Me.cmbShip.SetFocus
Exit Sub
Else
'**** Save Changes ****
Dim db As Database, rsCust As Recordset
Set db = CurrentDb
Dim strSQL As String

strSQL = "UPDATE tblShip_Reg "
strSQL = strSQL & "SET Ship= """ & Me![Ship] & """"
strSQL = strSQL & ", ShipCode= """ & Me![ShipCode] & """"
strSQL = strSQL & ", Ship_Type= """ & Me![Ship_Type] & """"
strSQL = strSQL & ", Ship_ID= " & Me![Ship_ID]


MsgBox strSQL

db.Execute strSQL

MsgBox "Changes have been saved."

DoCmd.Close
DoCmd.OpenForm "frmMainMenu"
End If
Exit_cmdSave_Click:
Exit Sub

Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
---------------------------- end code------------------------
I dont get any error,can any one tell me what is wrong with code ?
Thanks

Reply With Quote
  #2  
Old November 20th, 2003, 01:24 AM
alam alam is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 67 alam User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 57 m 17 sec
Reputation Power: 6
Quote:
I dont get any error ,can any one tell me what is wrong with code ?

still asking what's wrong if you don't get any error???

strSQL = strSQL & "SET Ship= """ & Me![Ship] & """"
you're having too many """"" in the wrong place?

This might work? strSQL = strSQL & "SET Ship =" & Me![Ship]

There's a "close" for every "open".
There's a "open" for every "close".

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > what is wrong with this code ????


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT