473,320 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Trying to validate data in a field on button click. Its not working...

I want to confirm a number was entered before allowing the click to proceed. The click does work on its own but when I add the first If statement below it does not display the message....however when I change to greater than (>), it does run the 1st message below when a number is entered. It just doesn't display the message when it is set to less than (<) and no number is entered.

Private Sub Add_Work_Order___Click()

If Me.Work_Order_Num < 1# Then

MsgBox "You must enter a work order number for this request."

End If

Dim Msg As String
Msg = "Have you confirmed all information is accurate?"
If MsgBox(Msg, 32 + 4) = 6 Then
SendKeys "%egw"
DoCmd.GoToRecord , , acNewRec

End If
End Sub
Nov 7 '10 #1
3 2265
ADezii
8,834 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. 'Make sure that a Valid Number has been entered, and that it is >= 1
  2. If Not IsNumeric(Me.Work_Order_Num) Or Me.Work_Order_Num < 1 Then
  3.   MsgBox "You must enter a work order number greater than 1 for this request."
  4. End If
Nov 7 '10 #2
Thanks ADezii. I did get that working. Can you please look at my latest question? It's titled:
"Problem copying from one record to another."
Posted about an hour ago.

Any help is appreciated.
Nov 8 '10 #3
ADezii
8,834 Expert 8TB
I believe that I already have, Jeff.
Nov 8 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: fred | last post by:
I'm trying to validate data entered into a form field by using a Query. I've discovered that the validation rule is pretty useless if you need anything other than very basic validation. I've...
6
by: Michael Johnson Jr. | last post by:
I am trying to handle a button click event, which updates a web control table with data. The button is dynamically created in the table itself. When I call updateTable() in the Page_Load the new...
2
by: Stu | last post by:
Hi, When I try and use Javascript to post page form data from one aspx page to another I get the error 'Unable to validate data. '. I am not trying to read the data using web controls I am...
1
by: Waqas Pitafi | last post by:
Hi, 3rd day is already gone without any solution. My problem is, I have a Windows Server 2003 sp1 machine as my development platform having NTFS filesystem. Other notable components installed...
16
by: Barry Gilmore | last post by:
Is there a way to disable a button after it is clicked? I am trying to avoid having someone click on it twice while they wait for it to process. Thank you!
5
by: sjl | last post by:
I've got an .aspx webform for searching my database. It basically takes user input and passes it as a parm into a stored proc to search a table. The results are returned in a SQLDataReader and...
4
by: Winista | last post by:
I have a page with bunch of user controls and standard controls on the page. And then I have a Button control on the page which is used to save the data on server side. All was working fine and...
2
by: lavu | last post by:
I am trying to start a C# GUI App and automatically trigger a button click event. However when I add a statement btn.PerformClick to my Main() I get an error that a class was expected . This...
2
by: Rajeesh123 | last post by:
I have a dom tree(same kind of treeview in .net). when user clicks on it , I pass the id to a hidden field and update it with ajax. The main page has one if clause to get the condition of hidden...
1
by: markla | last post by:
Hi, Can someone help me understand why for the code below, when added as a "FieldTemplate" in Dynamic Data, and rendered for a field, does not trigger the "test" function and hence update the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.