M
Meilu
I don't know why I can't open a recordSet.
I want to open a recordSet so I can access a value and set
a field in my form equal to that value.
Below is my Code. There are no compiler errors ... only
run time erros ... something about parameters not being
correct... (It's in chinese so I can't fully understand
the error message... )
Private Sub Product_AfterUpdate()
Dim db As Database
Dim rec As Recordset
Dim strQry As String
strQry = "Select Price " & _
" From SupplierProduct " & _
" WHERE EntityName = " & Me!Vendor & " AND
Product = " & Me!Product
Set db = CurrentDb()
Set rec = db.OpenRecordset(strQry, dbOpenDynaset) <--
this is where the error is!
Me!Cost = rec!Price
End Sub
Is it possible that the qry is wrong? Because I used the
same exact code to do something similiar ... and it works
just fine!
Any help would be greatly appreciated!
Meilu
I want to open a recordSet so I can access a value and set
a field in my form equal to that value.
Below is my Code. There are no compiler errors ... only
run time erros ... something about parameters not being
correct... (It's in chinese so I can't fully understand
the error message... )
Private Sub Product_AfterUpdate()
Dim db As Database
Dim rec As Recordset
Dim strQry As String
strQry = "Select Price " & _
" From SupplierProduct " & _
" WHERE EntityName = " & Me!Vendor & " AND
Product = " & Me!Product
Set db = CurrentDb()
Set rec = db.OpenRecordset(strQry, dbOpenDynaset) <--
this is where the error is!
Me!Cost = rec!Price
End Sub
Is it possible that the qry is wrong? Because I used the
same exact code to do something similiar ... and it works
just fine!
Any help would be greatly appreciated!
Meilu