View Full Version : Eliminate TextBox


mapat
07-09-2007, 08:20 AM
hello,
another problem that I have is as follows:

I have 2 txtBoxes and a button (txtA, txtB, btn). When opening the form I fill in txtA and txtB. Now when clicking on the button "btn" (OnClick event), the program is supposed to compare the values in the 2 txtboxes. If they are equal (txtA=txtB), then I have to do something which is not relevant to my question. In the code I type:

if (Me.txtA.Value = Me.txtB.Value) then
' DO WHATEVER
End if

and it does not even go through the conditional statement if to do whatever I want the program to do inside the if. I would really appreciate anyone's help.

Thank you very much
PS: By the way, thank you boblarson and rainman89 for the past question, both solutions worked, I used boblarson's but I have to click on the form when it's opened in order for the changes in the table to take effect.

boblarson
07-09-2007, 08:23 AM
Use CurrentDb.Execute to execute the query instead

rainman89
07-09-2007, 08:23 AM
go to tools>options edit/find. under the confirm part turn off your record changes and action queries.

note this is risky as sometimes action queries will occur w/o asking for confirmation

EDIT:::: Try boBs method first!!!