Personalized MSGBOX

  • Thread starter Thread starter Adrian
  • Start date Start date
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

--------------------------------------------------------------------------------
 
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
 
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!
 
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!
 
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
 
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
 
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
 
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
 
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
 
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
 
Back
Top