Hi,
I'm new to VBA and cannot figure this one out. I'm sure it's quite simple and is probably a rookie error, so I'd appreciate any help.
I'm executing the following code and get the 3065 run time error when I attempt it. The text of the error is "cannot execute a SELECT query". What I'm trying to do is obtain a value from a different table based on a value of a control in the current form.
Dim ls_holdamt
Dim rsmt As DAO.Recordset, dbs As DAO.Database
Set dbs = CurrentDb
sqlstring = "SELECT Bondclass!bondamount AS [ls_holdamt] FROM Bondclass WHERE Bondclass!class = Me!Combo83.Value;"
dbs.Execute sqlstring
Thanks for any suggestions!!
Kathy in Colorado
I'm new to VBA and cannot figure this one out. I'm sure it's quite simple and is probably a rookie error, so I'd appreciate any help.
I'm executing the following code and get the 3065 run time error when I attempt it. The text of the error is "cannot execute a SELECT query". What I'm trying to do is obtain a value from a different table based on a value of a control in the current form.
Dim ls_holdamt
Dim rsmt As DAO.Recordset, dbs As DAO.Database
Set dbs = CurrentDb
sqlstring = "SELECT Bondclass!bondamount AS [ls_holdamt] FROM Bondclass WHERE Bondclass!class = Me!Combo83.Value;"
dbs.Execute sqlstring
Thanks for any suggestions!!
Kathy in Colorado