473,836 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check if user enter a value in a text box when click on save button

21 New Member
Hi All,

Thanks you in advance for your help. I am working on a form that has text box for Budget information, combo box for location and list box for population which is related to locations combo items.

I would like to make sure that all information has been selected before clicking the save record button. If not, prompt users to make the proper selection based on the information provided.

When I check if the combo box item has been selected, everything works fine as well as for the list box. The only issue is checking on the text box whether data has been entered or not. Below is my code to check this one out. Please let me know what the best solution to this problem is.

Private Sub cmdSaveDWData_C lick()

If Me.cboLocationI D.ListIndex = "-1" Then
MsgBox "A selection is requiered for location and Budget information", vbCritical, EnterLocation
Me.cboLocationI D.SetFocus
Exit Sub
End If


If Len(Me.txtBudge tDW & "") = 0 Then
MsgBox "Enter Buget Information", vbInformation, BudgetInfoDW
Me.txtBudgetDW. SetFocus
Exit Sub
End If


If Me.lstTargetPop DW.ListIndex < 0 Then
MsgBox "A selection is required for Target Population", vbInformation, USLocation
Me.lstTargetPop DW.SetFocus
Exit Sub
End If

End sub
Mar 4 '11
10 13982
JoeKid09
21 New Member
Great! Thanks again for your valuable help
Mar 7 '11 #11

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

Similar topics

9
3622
by: msnews.microsoft.com | last post by:
Hello! I'm Jim by asp How can show "abc" in textbox when click one botton?
5
3899
by: Matt | last post by:
I want to write a generic clearForm function to clear the form when the user click CLEAR button. Here's my attempts, because I want to take care all html controls. I think I need to test if the control is submit button, regular button. But I don't know what I should do on drop down box? function clearForm() { var i=0;
2
7521
by: Shyguy | last post by:
Is there any way to stop Access from highlighting all the text in a memo box? If I click again the text is no longer highlighted, but I would like to get it to not highlight at all. Thanks for any help, ShyGuy
2
7706
by: ambersaria420 | last post by:
I need to prompt the user to enter ID. I can open up prompt fine using javascript code below. However I am not sure how to get value that user entered in user prompt window. I have to check this value to see if it exists in the database. Private Sub btnID_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnID.Click Dim strPop As String strPop = "<script language='javascript'>" & vbCrLf & "var temp =...
2
1791
by: subba_reddy | last post by:
Hi, I have iFrame and command button(webser control) in my aspx page, I want to populate the iframe with someohter page when I click on command button . - SUBBA
0
2648
by: ayneekeaw | last post by:
When I click the update button/link at the Gridview to update the data from drop down list into the SQL. The selected value of drop down list change to default value. How can I fix this problem
8
2482
by: wish | last post by:
Dear all, I would to ask that why the user always faced the different page when user click the back button instead back to page2.php but it go to page5.php..I remember in asp, we use the global.asa to solve this problem because the server will confuse when many user login the system as a member and every members go different pages. So may i have anyone to guide me?
5
6979
by: prebeni | last post by:
Hi I'm new into vb.net - so please forgive me :-) It's in a windows form - in visual basic 2005. How do I make a small text be visual when the user move the mouse over a button? In html you can do it with pictures like: <img src="pil.jpg" alt="some text" /> Best Regards Preben, Denmark
0
1519
by: tilak p | last post by:
hiiiii i have a asp.net page which contains gridview after entering data to gridview and updating in gridview i have given a save button on pressing it the data in grid will be sent to save function to save in database but when i click save it shows below error Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it...
4
5467
by: negus | last post by:
so basically i have a textbox and i need to be able to hit the enter key and have it click a button its for my web browser project im doing for a final and cant seem to figure it out i have the textbox for the URL area and a go button. thanks for your help in advance!
0
10831
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10582
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6976
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5815
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4446
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3108
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.