vba-select problem - TechRepublic
General discussion
May 23, 2002 at 10:43 PM
r.keizers

vba-select problem

by r.keizers . Updated 24 years ago

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

This discussion is locked

All Comments