A
Asif
I have a table tbl_Cost. In my form I have a combo box (cmb_Year) and
a textbox (Text7). Now the control source of Text 7 is
=DLookUp("[COSTYear]","[tbl_COSTAPPEND]","[cmb_Year] =[COSTYear] ")
The rowsource of the cmb_Year is
SELECT tbl_YEAR.YEARID, tbl_YEAR.YEAR
FROM tbl_YEAR;
On the After update event of this combo box I have the following code;
Me.Refresh
If Me.cmb_Year = Me.Text7 Then
MsgBox ("Duplicate")
End If
Now if I select the year 2007 from cmb_Year then Text 7 will also
display 2007, but if i select 2008 from cmb_Year then Text 7 will be
empty. However the above code doesn't work as I want it to if the
above condition is true a message box doesn't appear, is there
something wrong with my code
Thanks
a textbox (Text7). Now the control source of Text 7 is
=DLookUp("[COSTYear]","[tbl_COSTAPPEND]","[cmb_Year] =[COSTYear] ")
The rowsource of the cmb_Year is
SELECT tbl_YEAR.YEARID, tbl_YEAR.YEAR
FROM tbl_YEAR;
On the After update event of this combo box I have the following code;
Me.Refresh
If Me.cmb_Year = Me.Text7 Then
MsgBox ("Duplicate")
End If
Now if I select the year 2007 from cmb_Year then Text 7 will also
display 2007, but if i select 2008 from cmb_Year then Text 7 will be
empty. However the above code doesn't work as I want it to if the
above condition is true a message box doesn't appear, is there
something wrong with my code
Thanks