Problem with code builder.

Riaang

Board Regular
Joined
Aug 29, 2002
Messages
146
Hi all, :biggrin:

I have the following code builder. It seems to work fine but I want the cursor to go back to the Letter Posted field after you press OK on the error message box.

Private Sub Reason__Letter_Not_Posted__Exit(Cancel As Integer)
If Letter_Posted = "No" And Reason__Letter_Not_Posted_ = "N/A" Then
MsgBox "Please supply a valid reason for not posting this letter."

End If
End Sub

Any :rolleyes: will be appreciated.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hullo. Try this:
Code:
Private Sub Reason__Letter_Not_Posted__Exit(Cancel As Integer) 
If Letter_Posted = "No" And Reason__Letter_Not_Posted_ = "N/A" Then 
MsgBox "Please supply a valid reason for not posting this letter." 
Me.Letter_Posted.SetFocus
End If
End Sub

HTH (y)

P
 
Upvote 0
Just a stupid question that I seem to struggle a lot with.

How do I change this code to instead of saying = N/A it must show the message when this field is blank.

Reason__Letter_Not_Posted_ = "N/A" it must

Thanks again :oops:
 
Upvote 0

Forum statistics

Threads
1,221,543
Messages
6,160,421
Members
451,644
Latest member
hglymph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top