Hello Michael,
I'm trying to use the stored procedure that you helped me build the
other day. The following is my situation. I hope that it is clear and that
you know a little about access as well as SQL Server:
In a sub routine/module I have an IF/THEN/ELSE Statement:
Dim sSQL As String
Dim rsUPDATE As DAO.Recordset
Dim DB As Database
Set DB = CurrentDb
If Form_frmHeatingSpecial.txtSpecNet = "1000" Then
sSQL = "SELECT proddta_F4072.ADAN8, proddta_F4072.ADITM,
proddta_F4072.ADLITM"
sSQL = sSQL & " FROM proddta_F4072 INNER JOIN Heating1000 ON
proddta_F4072.ADITM = Heating1000.ADITM"
sSQL = sSQL & " WHERE proddta_F4072.ADAN8 = " &
Form_frmHeatingSpecial.TxtCustomerNum & " "
Set rsUPDATE = CurrentDb.OpenRecordset(sSQL, dbOpenSnapshot)
If rsUPDATE.EOF Then
MsgBox "This is not a returning customer.", vbCritical, "Legend
Valve Heating Special"
Form_frmHeatingSpecial.TxtCustomerNum = Null
Form_frmHeatingSpecial.txtSpecNet = Null
Form_frmHeatingSpecial.TxtCustomerNum.SetFocus
Exit Sub
Else
Pass_through Query
End If
End If
On the Else statement, I want to call my stored procedure, which is called
heatingspecial. This is where I get confused. How do I call a stored
procedure from SQL Server? Here is my stored procedure:
+ 1 AS
VARCHAR(2)), 1)) +
Also, as you can see in the update section of the stored procedure, I want
entered by a user from a form. I would love any advise. I have never
worked with stored porcedures before.
Chris