Good morning All:
I have the following code attached to a button using the on_click event. It is supposed to look up a rate on a table based on the field name I select from a drop down, matching the size of the circuit to the size already recorded in another table. I am getting a "Too few parameters. Expected 2." error on my OpenRecordset line:
Set rs = CurrentDb().OpenRecordset("SELECT " & strField & " FROM tblBillingRates WHERE Mbps = ' " & txtSizeMB & " ' "
strField is assigned a text value based on the abbrev selected from a drop down and txtSizeMB is stored in a table and loaded into the form. This query should return only one field of one record which I will assign to a text box by:
txtRate = rs(strField)
I use similar code on another section of my form to populate a location code based on a city state combo selected from a drop down and that works fine.
Any help will be appreciated. Thanks!
I have the following code attached to a button using the on_click event. It is supposed to look up a rate on a table based on the field name I select from a drop down, matching the size of the circuit to the size already recorded in another table. I am getting a "Too few parameters. Expected 2." error on my OpenRecordset line:
Set rs = CurrentDb().OpenRecordset("SELECT " & strField & " FROM tblBillingRates WHERE Mbps = ' " & txtSizeMB & " ' "
strField is assigned a text value based on the abbrev selected from a drop down and txtSizeMB is stored in a table and loaded into the form. This query should return only one field of one record which I will assign to a text box by:
txtRate = rs(strField)
I use similar code on another section of my form to populate a location code based on a city state combo selected from a drop down and that works fine.
Any help will be appreciated. Thanks!