Message box

D

Dan @BCBS

In this POP-Up Message box - is there a way to make the 999 any number???
So no matter what follows the firs 5 values, my message box will appear..

If Me.MBR_GROUPNO = "51735-999" Then
MsgBox "Check ERISA 180 Day Requirement"
DoCmd.CancelEvent
End If


Thanks
 
D

Dan @BCBS

Cannot do this - the text box has an Input Mask = AAAAA\-AAA;0;*
And I have code to make the useer enter a 9 digit number ie:12345-678

Is there some kind of Wildcard like AAAAA-***
ie: If Me.MBR_GROUPNO = "51735-***" Then

I tried this and it don'e work..

Any Suggestions - PLEASE..
 
B

BruceM

Did you try using Left?

Dan @BCBS said:
Cannot do this - the text box has an Input Mask = AAAAA\-AAA;0;*
And I have code to make the useer enter a 9 digit number ie:12345-678

Is there some kind of Wildcard like AAAAA-***
ie: If Me.MBR_GROUPNO = "51735-***" Then

I tried this and it don'e work..

Any Suggestions - PLEASE..
 
D

Dan @BCBS

No I have not, are you suggesting Left with a String command???
Could you please tell me how a Left command would target the 7,8,9 values..

Thanks
Dan
 
B

BruceM

One approach is to use the following as the After Update event for the text
box that is bound to MBR_GROUPNO:
If Left(Me.MBR_GROUPNO, 5) = "51735" Then
msgbox "Your message here"
Cancel = True
End If

To place this in the After Update event, select the combo box in form design
view, then click View > Properties. Click the Events tab. Click After
Update. Click the three dots that appear on the right, then click Code
Builder, then click OK. In the code window that appears you should see the
cursor blinking between a line that reads "Private Sub ..." and one that
read "End Sub". Insert the code between those lines, substituting your
actual field and control names as needed.
 
D

Dan @BCBS

The Left command works fine, but I put it into the first Sub - instead of the
BEFORE UPDATE:

If Left(Me.MBR_GROUPNO, 5) = "51735" Then
MsgBox "Check ERISA 180 Day Requirement"
DoCmd.CancelEvent
End If

Thanks for the help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top