I thought I was very specific in this SQL request. There is a form open
with a selected record (and a corresponding "lngRecipeID" on that form. The
table also has a field called "lngRecipeID". But I keep getting this error:
Runtime Error 3061: Too Few Parameters expected 1. What should I be looking
for to fix this?
Here's my code so far:
Private Sub cmdAddIngredientToRecipe_Click()
Dim dbGetRecipeID As DAO.Database
Dim rsGetRecipeID As DAO.Recordset
Dim StrSQL As String
Set dbGetRecipeID = CurrentDb()
StrSQL = "SELECT tblRecipes.lngRecipeID FROM tblRecipes WHERE
tblRecipes.lngRecipeID = frmRecipes.lngRecipeID;"
Set rsGetRecipeID = dbGetRecipeID.OpenRecordset(StrSQL, dbOpenDynaset)
MsgBox rsGetRecipeID 'just to test the query before going any further
End Sub
Thanks.