Hello, I'm a newbie at vb6 programming, I seem to have gotten stuck at a problem I can't resolve for several days now.
I'm developing a payroll system using vb6 as front end and Access 2003 as back end. I have a label in my form, let's call it lblA. This label is supposed to be a numeric value, determined by another value in the same form, let's call it curA.
In my Access tables, I have one called tblA, which has 3 columns, Range1, Range2 and Value. My curA falls between Range1 and Range2, which in turn will yield Value. This Value will be shown in lblA.
Thus, if curA=2000, it'll be somewhere between R1=1900 and R2=2300 (let's say) and Value=25. My lblA is supposed to show 25.
I've attempted to use SQL to accomplish my task, i.e. strSQL="SELECT * FROM tblA WHERE Range1<=curA<=R ange2"
lblA=rec1!Value
But it doesn't work. I've tried tinkering around with lots of variations, among them assigning the curA as string before passing it down to the SQL...but nothing seems to work. Recently I discovered this DLookUp function, but I am in doubts as to whether it could incorporate the BETWEEN...AND operacors...
Any help would be greatly appreciated.
I'm developing a payroll system using vb6 as front end and Access 2003 as back end. I have a label in my form, let's call it lblA. This label is supposed to be a numeric value, determined by another value in the same form, let's call it curA.
In my Access tables, I have one called tblA, which has 3 columns, Range1, Range2 and Value. My curA falls between Range1 and Range2, which in turn will yield Value. This Value will be shown in lblA.
Thus, if curA=2000, it'll be somewhere between R1=1900 and R2=2300 (let's say) and Value=25. My lblA is supposed to show 25.
I've attempted to use SQL to accomplish my task, i.e. strSQL="SELECT * FROM tblA WHERE Range1<=curA<=R ange2"
lblA=rec1!Value
But it doesn't work. I've tried tinkering around with lots of variations, among them assigning the curA as string before passing it down to the SQL...but nothing seems to work. Recently I discovered this DLookUp function, but I am in doubts as to whether it could incorporate the BETWEEN...AND operacors...
Any help would be greatly appreciated.
Comment