what Is wrong with this code?

puthenveetil

Registered User.
Local time
Tomorrow, 02:14
Joined
Aug 9, 2004
Messages
94
HI all,

I am trying to use this code, but it is not working. If someone can please correct this... :o

If Me.Text83 = Me.Recip_ID Then

'do nothing

Else
strMsg = "The Photo Selected is not Correct one. Do you want to change?"

If MsgBox(strMsg, vbQuestion + vbYesNo, "Change Photo?") = vbYes Then
getFileName
Else
DoCmd.RunCommand acCmdUndo

End If
End If

Thanks in advance

Thanks
 
Why is it not working?

Do you get an error message? If so, what's the message?

What's getFileName?
 
HI SJ,

When this code executed, the process halted. No error message is popping.simply stops execution.

getfileName is a browsing utility to get filename.


thanks
 
puthenveetil said:
getfileName is a browsing utility to get filename.

Is it a sub or a function that runs it?

Also, there's no need to have ' do nothing in your code.

Code:
If Me.Text83 <> Me.Recip_ID Then
    strMsg = "The Photo Selected is not Correct one. Do you want to change?"

    If MsgBox(strMsg, vbQuestion + vbYesNo, "Change Photo?") = vbYes Then
        getFileName
    Else
        DoCmd.RunCommand acCmdUndo
    End If
End If
 
SJ,

sorry boss, still halts
getfileName is a function and that is working fine

When I tried to run the code like this;

If Me.Text83 <> Me.Recip_ID Then

MsgBox "correct one"

Else
'strMsg = "The Photo Selected is not Correct one. Do you want to change?"
msgbox "wrong one"
'If MsgBox(strMsg, vbQuestion + vbYesNo, "Change Photo?") = vbYes Then
'getFileName
'Else
'DoCmd.RunCommand acCmdUndo
getFileName
'End If
End If

and it works fine....
If I used the second If then else endif it stops.

Thanks
 
Change:

DoCmd.RunCommand acCmdUndo

To:

Me.Undo
 

Users who are viewing this thread

Back
Top Bottom