Hello,
I am in the process of converting an Access 2000 Database to an Access 2000 Project with an SQL server 2000 backend. I am having a problem passing information I selected from my combo box to the stored procedure. I verified the procedure works because I get the information I entered in the popup box on the next form. I have included the portion of the form and the Stored procedure.
I am relatively new to database programming so any help would be appreciated.
Click on Form Button Code
Private Sub Command143_Click()
Dim strlink As String
Me.BOM.SetFocus
Me.Command143.Visible = False
Me.Combo142.Visible = False
If Not IsNull(Me.Combo142) Then
strlink = "[Type de système]= Forms![Main]![Combo142]"
End If
DoCmd.OpenForm "FCustomer", acNormal
', , strlink
Forms![FCustomer]![LABEL].Caption = Forms![Main]![Combo142]
End Sub
Stored Procedure Code
Alter Procedure "QCustomer"
(
@Types NVarchar(50)
)
As
SELECT [Type de système], [Numéro de système], NomSociete,
Adresse, CodePostal, Ville, Country, TelProfessionnel,
Departement, [Instructor desk phone], NumTelecopie, Email,
NomContact, Remarques, Lanes, Software
FROM dbo.TCustomer
WHERE [Type de système] = @Types
return
I am in the process of converting an Access 2000 Database to an Access 2000 Project with an SQL server 2000 backend. I am having a problem passing information I selected from my combo box to the stored procedure. I verified the procedure works because I get the information I entered in the popup box on the next form. I have included the portion of the form and the Stored procedure.
I am relatively new to database programming so any help would be appreciated.
Click on Form Button Code
Private Sub Command143_Click()
Dim strlink As String
Me.BOM.SetFocus
Me.Command143.Visible = False
Me.Combo142.Visible = False
If Not IsNull(Me.Combo142) Then
strlink = "[Type de système]= Forms![Main]![Combo142]"
End If
DoCmd.OpenForm "FCustomer", acNormal
', , strlink
Forms![FCustomer]![LABEL].Caption = Forms![Main]![Combo142]
End Sub
Stored Procedure Code
Alter Procedure "QCustomer"
(
@Types NVarchar(50)
)
As
SELECT [Type de système], [Numéro de système], NomSociete,
Adresse, CodePostal, Ville, Country, TelProfessionnel,
Departement, [Instructor desk phone], NumTelecopie, Email,
NomContact, Remarques, Lanes, Software
FROM dbo.TCustomer
WHERE [Type de système] = @Types
return