Hi,
I have a button on my order form. I have written the following code on on-click event of the button to read one of values from the order form and return some values using query. In my code I put a msg box to test the query.Anyways, my problem is that I get an error "too few parameters. expected 1". Can somebody please help me with this.
I have a button on my order form. I have written the following code on on-click event of the button to read one of values from the order form and return some values using query. In my code I put a msg box to test the query.Anyways, my problem is that I get an error "too few parameters. expected 1". Can somebody please help me with this.
Code:
Private Sub Command81_Click()
Dim dbs As DAO.Database
Dim rstTest As DAO.Recordset
Dim strQuery As String
strQuery = "SELECT ProjectT.Project_ID, ProjectT.ShippingAddress1, ProjectT.ShippingAddress2, ProjectT.ShippingCity, ProjectT.ShippingProvince, ProjectT.ShippingCountry, ProjectT.ShippingPostalCode, ProjectT.ShippingPhone, ProjectT.ShippingEmail, ProjectT.ShippingFax " + _
"FROM ProjectT " + _
"WHERE (((ProjectT.Project_ID)=[Forms]![Order F(Blank)]![Project_ID]));"
Dim db As Database
Set db = CurrentDb
Set rstTest = db.OpenRecordset(strQuery)
If Not rstTest.EOF Then
MsgBox "rstTest![ShippingAddress1]"
End If
End Sub