J
j.t.w
Hi NG,
I'm having a problem. I just moved my tables over to SQL Server 2000.
I'm using A2K as the front-end.
For now, all I'm trying to do is to grab the PONumber in the
PO_NextNumber table and then increment it.
Using the SQL Query Analyzer, I can update the table. I then copied
the syntax from there. What I'm getting is a "Syntax error in UPDATE
statement" error message.
*************Code Start******************************
Private Sub cmdAdd_Click()
Dim intPONumber As Double
intPONumber = DLookup("PONumber", "PO_NextNumber")
strSQL = "UPDATE [MyDB].[dbo].[PO_NextNumber] " & _
"Set [PONumber] = " & intPONumber + 1
CurrentDb.Execute strSQL
Me.PONo = intPONumber
End Sub
*************Code End********************************
Could someone please let me know where my syntax is wrong?
Also, when adding a record in Access, the autonumber is immediately
generated and shows on the form. SQL Server generates the Identity
number when the record is submitted. How would I go about creating and
running a stored procedure to act like Access's Autonumber feature?
Thanks for any and all help. I still have soooo much to learn.
j.t.w
I'm having a problem. I just moved my tables over to SQL Server 2000.
I'm using A2K as the front-end.
For now, all I'm trying to do is to grab the PONumber in the
PO_NextNumber table and then increment it.
Using the SQL Query Analyzer, I can update the table. I then copied
the syntax from there. What I'm getting is a "Syntax error in UPDATE
statement" error message.
*************Code Start******************************
Private Sub cmdAdd_Click()
Dim intPONumber As Double
intPONumber = DLookup("PONumber", "PO_NextNumber")
strSQL = "UPDATE [MyDB].[dbo].[PO_NextNumber] " & _
"Set [PONumber] = " & intPONumber + 1
CurrentDb.Execute strSQL
Me.PONo = intPONumber
End Sub
*************Code End********************************
Could someone please let me know where my syntax is wrong?
Also, when adding a record in Access, the autonumber is immediately
generated and shows on the form. SQL Server generates the Identity
number when the record is submitted. How would I go about creating and
running a stored procedure to act like Access's Autonumber feature?
Thanks for any and all help. I still have soooo much to learn.
j.t.w