if if condition not work proper (1 Viewer)

carl024

Registered User.
Local time
Today, 06:31
Joined
Nov 21, 2011
Messages
48
use code in vba unbound
if condition work after few minute if condition not work and show wrong result
 

pr2-eugin

Super Moderator
Local time
Today, 14:31
Joined
Nov 30, 2011
Messages
8,494
Explain a bit more, maybe with some examples or actual code you have used this time.
 

carl024

Registered User.
Local time
Today, 06:31
Joined
Nov 21, 2011
Messages
48
this part not work proper------
complete code give you guide me
-------------------------------------------------------------------------
ElseIf aa > bb Then
Ram.BackColor = 10092543
MsgBox "Please !!!Check your Amount Again !!!!"
DoCmd.GoToControl "ram"
--------------------------------------------------------------------
Private Sub save_new_Click()

Dim aa As Long
Dim bb As Long

aa = Me!Ram
bb = Me!total

If IsNull([RD]) Then
RD.BackColor = 10092543
DoCmd.GoToControl "rd"

ElseIf DCount("[rdate]&[aname]", "dtrans", "[rdate]&[aname]= forms!recover!rD & forms!recover!an") > 0 Then
MsgBox "You can not enter this date data again!"
DoCmd.GoToControl "rD"

ElseIf IsNull([an]) Then
an.BackColor = 10092543
DoCmd.GoToControl "an"

ElseIf IsNull([Ram]) Then
Ram.BackColor = 10092543
DoCmd.GoToControl "ram"

ElseIf aa > bb Then
Ram.BackColor = 10092543
MsgBox "Please !!!Check your Amount Again !!!!"
DoCmd.GoToControl "ram"
Else

DoCmd.SetWarnings off
DoCmd.RunSQL "INSERT INTO dtrans ( rdate, aname, rec_amount ) SELECT forms!recover!rd AS rdate, forms!recover!an AS aname, forms!recover!ram AS rec_amount;"

RD.BackColor = 16777215
an.BackColor = 16777215
Ram.BackColor = 16777215

Me.RD = Null
Me.an = Null
Me.total = Null
Me.Ram = Null

DoCmd.GoToControl "rd"
Me.Refresh

End If
End Sub
 

Users who are viewing this thread

Top Bottom