Personalized MSGBOX

A

Adrian

Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills those requirements....

How I do it?

--------------------------------------------------------------------------------


Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent, True
Else
MsgBox "La IPP no se encuetra cargada en la base", , "Advertencia!"
End If

End Sub

--------------------------------------------------------------------------------
 
D

Douglas J Steele

If IsNumeric(Me.TXTBUSCAR) = False Then
Msgbox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", , "Advertencia!"
End If
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills those
requirements....

How I do it?




Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", , "Advertencia!"
End If

End Sub
 
U

UTOPIAN

I write "letters" and "0 value" in the TextBox then I press the command button... and appears the Default MsgBox error of Access, Not the Personalized one!!

help me!!!!!

thanks!
 
D

Douglas J Steele

What event did you put the code into? Is the textbox bound to a field or
not?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I write "letters" and "0 value" in the TextBox then I press the command
button... and appears the Default MsgBox error of Access, Not the
Personalized one!!

help me!!!!!

thanks!
 
D

Dreamer

I have a txtbox + command button for the search. I ADD your code in this:

Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", , "Advertencia!"
End If

End Sub




Douglas J Steele said:
What event did you put the code into? Is the textbox bound to a field or
not?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I write "letters" and "0 value" in the TextBox then I press the command
button... and appears the Default MsgBox error of Access, Not the
Personalized one!!

help me!!!!!

thanks!




Douglas J Steele said:
If IsNumeric(Me.TXTBUSCAR) = False Then
Msgbox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills
those
requirements....

How I do it?




Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub
 
D

Douglas J. Steele

Did you keep your code there? My code incorporated your code: if your code
is still there ahead of mine, then you will have errors.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Dreamer said:
I have a txtbox + command button for the search. I ADD your code in this:

Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", , "Advertencia!"
End If

End Sub




Douglas J Steele said:
What event did you put the code into? Is the textbox bound to a field or
not?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I write "letters" and "0 value" in the TextBox then I press the command
button... and appears the Default MsgBox error of Access, Not the
Personalized one!!

help me!!!!!

thanks!




Douglas J Steele said:
If IsNumeric(Me.TXTBUSCAR) = False Then
Msgbox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills
those
requirements....

How I do it?




Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub
 
D

Dreamer

of course I replace my code with yours! but only work if I put a zero value
...... otherway show MSGBOXes by default...
Thanks a lot for your help!

Douglas J. Steele said:
Did you keep your code there? My code incorporated your code: if your code
is still there ahead of mine, then you will have errors.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Dreamer said:
I have a txtbox + command button for the search. I ADD your code in this:

Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub




Douglas J Steele said:
What event did you put the code into? Is the textbox bound to a field or
not?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I write "letters" and "0 value" in the TextBox then I press the command
button... and appears the Default MsgBox error of Access, Not the
Personalized one!!

help me!!!!!

thanks!




"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escribió en el
mensaje If IsNumeric(Me.TXTBUSCAR) = False Then
Msgbox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills
those
requirements....

How I do it?




Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub
 
D

Douglas J. Steele

Please post your current version of the routine.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Dreamer said:
of course I replace my code with yours! but only work if I put a zero
value ..... otherway show MSGBOXes by default...
Thanks a lot for your help!

Douglas J. Steele said:
Did you keep your code there? My code incorporated your code: if your
code is still there ahead of mine, then you will have errors.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Dreamer said:
I have a txtbox + command button for the search. I ADD your code in this:

Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub




"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escribió en el
mensaje What event did you put the code into? Is the textbox bound to a field
or
not?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I write "letters" and "0 value" in the TextBox then I press the command
button... and appears the Default MsgBox error of Access, Not the
Personalized one!!

help me!!!!!

thanks!




"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escribió en el
mensaje If IsNumeric(Me.TXTBUSCAR) = False Then
Msgbox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0
Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills
those
requirements....

How I do it?




Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0
Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub
 
D

Dreamer

Private Sub SEARCHNroIPP_Click()
If IsNumeric(Me.TXTBUSCAR) = False Then
MsgBox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, , acCurrent, True
Else
MsgBox "La IPP no se encuetra cargada en la base", , "Advertencia!"
End If
End If
End If

End Sub


--------------------------------------------------------------------------------

Douglas J. Steele said:
Please post your current version of the routine.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Dreamer said:
of course I replace my code with yours! but only work if I put a zero
value ..... otherway show MSGBOXes by default...
Thanks a lot for your help!

Douglas J. Steele said:
Did you keep your code there? My code incorporated your code: if your
code is still there ahead of mine, then you will have errors.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I have a txtbox + command button for the search. I ADD your code in this:

Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub




"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escribió en el
mensaje What event did you put the code into? Is the textbox bound to a field
or
not?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I write "letters" and "0 value" in the TextBox then I press the command
button... and appears the Default MsgBox error of Access, Not the
Personalized one!!

help me!!!!!

thanks!




"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escribió en el
mensaje If IsNumeric(Me.TXTBUSCAR) = False Then
Msgbox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0
Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills
those
requirements....

How I do it?




Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0
Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub
 
D

Dreamer

Douglas, I am so sorry!!!! I am so stupid!!! I use also validation
rules!!!!!!

Thanks a lot!!!

Douglas J. Steele said:
Please post your current version of the routine.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Dreamer said:
of course I replace my code with yours! but only work if I put a zero
value ..... otherway show MSGBOXes by default...
Thanks a lot for your help!

Douglas J. Steele said:
Did you keep your code there? My code incorporated your code: if your
code is still there ahead of mine, then you will have errors.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I have a txtbox + command button for the search. I ADD your code in
this:

Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0 Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub




"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escribió en el
mensaje What event did you put the code into? Is the textbox bound to a field
or
not?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I write "letters" and "0 value" in the TextBox then I press the
command
button... and appears the Default MsgBox error of Access, Not the
Personalized one!!

help me!!!!!

thanks!




"Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> escribió en el
mensaje If IsNumeric(Me.TXTBUSCAR) = False Then
Msgbox "You must enter only numbers"
Else
If CLng(Me.TXTBUSCAR) = 0 Then
MsgBox "The value must be different from zero"
ElseIf CLng(Me.TXTBUSCAR) < 0 Then
MsgBox "Please, enter some number > that zero"
Else
If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0
Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If
End If
End If

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello Group!

I have this code and I need add message boxes:

That say:

1- "You must enter only numbers"
2- "The value must be different from zero"
3- "Please, enter some number > that zero"

Obviously the code also will have to be modified so that it fulfills
those
requirements....

How I do it?




Private Sub SEARCHNroIPP_Click()

If DCount("*", "DBO_CAUSA", "[NumeroIPP]=" & Me.TXTBUSCAR) > 0
Then
Me.NumeroIPP.SetFocus
DoCmd.FindRecord Me.TXTBUSCAR, acEntire, , acSearchAll, ,
acCurrent,
True
Else
MsgBox "La IPP no se encuetra cargada en la base", ,
"Advertencia!"
End If

End Sub
 

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