By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,213 Members | 2,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,213 IT Pros & Developers. It's quick & easy.

How to prevent validation in VB form as seen in Oracle Forms

P: 21
Hi,
its Vandana. I m a begginer of VB, Trying to create a form Having three command buttons Add, Modify, Exit. I made coding & it is running well, but technically not very sound. I use lost focus event of text box to get data while modifying the record. this event will give me complete detail of record if exist or give me other textboxes blank if no data found. all is going well. But if i wanna Exiting my form after entering the key, i need to jump focus at Exit button. In this Case Lost Focus event occurs. Now i want to know is their any option available in VB which is the substitute of NO_Validate Command of Oracle Forms.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Addcmd_Click()
  2. con.Execute "insert into dept_master values('" & CInt(dept_code) & "','" & Dept_name & "')"
  3. MsgBox "1 Record Added"
  4. Form_Activate
  5. End Sub
  6.  
  7. Private Sub Modcmd_Click()
  8. con.Execute "update dept_master set dept_name = rec(0) where dept_code = " & CInt(dept_code)
  9. End Sub
  10.  
  11. Private Sub dept_code_LostFocus()
  12. Set rec = New ADODB.Recordset
  13. rec.Open "select dept_name from dept_master Where dept_code = " & CInt(dept_code), con, adOpenForwardOnly, adLockOptimistic
  14. If rec.EOF = True Then
  15. Dept_name.SetFocus
  16. Else
  17. dept_code.Enabled = False
  18. Dept_name.Text = rec(0)
  19. End If
  20. End Sub
  21.  
  22. Private Sub Form_Activate()
  23. dept_code.SetFocus
  24. Form_Load
  25. End Sub
  26.  
  27. Private Sub Form_Load()
  28. dept_code.Text = ""
  29. Dept_name.Text = ""
  30. create_connection
  31. End Sub
Mar 14 '07 #1
Share this Question
Share on Google+
4 Replies


vijaydiwakar
100+
P: 579
Hi,
its Vandana. I m a begginer of VB, Trying to create a form Having three command buttons Add, Modify, Exit. I made coding & it is running well, but technically not very sound. I use lost focus event of text box to get data while modifying the record. this event will give me complete detail of record if exist or give me other textboxes blank if no data found. all is going well. But if i wanna Exiting my form after entering the key, i need to jump focus at Exit button. In this Case Lost Focus event occurs. Now i want to know is their any option available in VB which is the substitute of NO_Validate Command of Oracle Forms.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Addcmd_Click()
  2. con.Execute "insert into dept_master values('" & CInt(dept_code) & "','" & Dept_name & "')"
  3. MsgBox "1 Record Added"
  4. Form_Activate
  5. End Sub
  6.  
  7. Private Sub Modcmd_Click()
  8. con.Execute "update dept_master set dept_name = rec(0) where dept_code = " & CInt(dept_code)
  9. End Sub
  10.  
  11. Private Sub dept_code_LostFocus()
  12. Set rec = New ADODB.Recordset
  13. rec.Open "select dept_name from dept_master Where dept_code = " & CInt(dept_code), con, adOpenForwardOnly, adLockOptimistic
  14. If rec.EOF = True Then
  15. Dept_name.SetFocus
  16. Else
  17. dept_code.Enabled = False
  18. Dept_name.Text = rec(0)
  19. End If
  20. End Sub
  21.  
  22. Private Sub Form_Activate()
  23. dept_code.SetFocus
  24. Form_Load
  25. End Sub
  26.  
  27. Private Sub Form_Load()
  28. dept_code.Text = ""
  29. Dept_name.Text = ""
  30. create_connection
  31. End Sub
Hi ,Vandana
write this code in validate event of ctrl and set its causesvalidate to false
ur problem will be get solved.
Mar 14 '07 #2

P: 21
Hi ,Vandana
write this code in validate event of ctrl and set its causesvalidate to false
ur problem will be get solved.
hi,
i use ur suggestion. but nothing is happening. please tell me where to set causesvalidation property of textbox. in begining of validation event, at end of validation event or at exit button.
Mar 15 '07 #3

vijaydiwakar
100+
P: 579
hi,
i use ur suggestion. but nothing is happening. please tell me where to set causesvalidation property of textbox. in begining of validation event, at end of validation event or at exit button.
no no
at design time or at form load time
Mar 15 '07 #4

P: 21
no no
at design time or at form load time
Hello sir,
Thanks. It is working now.
thx again.
Mar 16 '07 #5

Post your reply

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