Reputation: 0 Apprentice
- New Members
- Active Posts:
- 6 (0.01 per day)
- 14-December 12
- Profile Views:
- Last Active:
- Dec 25 2012 07:18 PM
- Dream Kudos:
Posts I've Made
Posted 17 Dec 2012Ok....thanks....
Posted 15 Dec 2012if the code is running but it is not doing what you want. the next question to ask yourself is this:
what is the code doing?
it's being a while i used vb6 but shouldn't *Controls in the loop* be assigned to something? like frm_name.controls or something like that?
hint: check how many times that loop iterates.
Problem solved.....Previously,when I pressed the clear button it did not take Controls as frm_supplier.Controls....I rewrote the function something like this....
Public Sub Clear(frm_name As Form) 'will empty the all fields on the form specified Dim a As Control For Each a In frm_name.Controls 'find each control in the specified form' If TypeOf a Is TextBox Then 'if the control is textbox then the value of the text will be set empty' a.Text = "" End If Next End Sub
And called it like this in frm_supplier.....
Private Sub cmd_ClearSupplier_Click() Call frm_itemlist.Clear(frm_supplier) End Sub
I am an amateur so I made the careless mistake.Thanks a million for your help......
Btw just one last query
Whats the problem in this code.....I am getting an error that says Invalid use of Property
Dim frm_name as Form frm_name=frm_supplier
Posted 15 Dec 2012still nothing.....its executing but still not doing anything....
Its executing fine in frm_itemlist.....Its when i try to call it from frm_itemlist it creates a problem.....
*It creates a problem when I run it from frm_supplier
Posted 15 Dec 2012And when I put a breakpoint in the fuction it tells me its executing but i cant see the outcome on the form....
Posted 15 Dec 2012do you get any errors when trying to run this code?
No errors whatsoever....When you say it doesn't execute, have you added a breakpoint within the function when you call it from the other form to confirm this?
Basically I'm asking, is it not executing at all, or is it executing and not behaving how you expect?
Its not executing at all.When i click cmd_ClearSupplier all the text boxes in the form should go blank but nothing happens.Seems like the button has got no coding in it.....
- Member Title:
- New D.I.C Head
- Age Unknown
- Birthday Unknown
mshayanshafi hasn't added any friends yet.