Hi all,
I am using the following code to automaticly increase a number in a texbox
SQL = “SELECT * FROM km1 WHERE [km1].[nmr] = ” & Me.nmr
Set qd = CurrentDb.CreateQueryDef(“”, SQL)
Set rs = qd.OpenRecordset
rs.MoveLast
nieuwnummer = rs.Fields![lnmr] + 1
rs.Close
This works great accept now i want the select statement to contain a double selection, something like ths: SELECT * FROM km1 WHERE [km1].[nmr] = ” & Me.NMR and [km1].[cdnmr] = “2”.
I can’t get it to work, probably because i can’t get the proper synthax. So if anyone could give me a pointer on how to properly use this select statement in the mentioned code i would be very gratefull.
Thanks,
Rob