Hi
I am quite new to VBA and access 2003 and I know this should be very easy.
I am trying to open a record set where the critieria is based on a program variable.
For example
<statements to provide connection to table>
Dim productionrun as string
productionrun = "1234"
rst.Open "select * from specimendata where runnumber = productionrun ", conn, adOpenForwardOnly, adLockReadOnly
I am hopeing this would select all records from the table specimendata where the field runnumber is equal to that of the variable productionrun (in this case 1234).
If I substitute productionrun for '1234' it works fine, I just can't seem to pass the variable across.
Any ideas on how best to do this.
Thanks