Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CODE OK ?

Status
Not open for further replies.

lode

Programmer
Nov 8, 2001
208
0
0
BE
Hi,

I'm trying to write an application for our our company
It has to handle the tickets and data of trucks who come weighing.
First part :
I have to fill in the licenseplate, when the licenseplate doenst't exists it gives an error, when the licenseplate does exist it fills in the licenseplate of the truck and the tare of the truck.
So this is how i started :

Private Sub txtKenteken_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtKenteken.Validating
DataSet11.KENTEKENS.Clear()
OleDbDataAdapter1.SelectCommand.Parameters("kenteken").Value = txtKenteken.Text
OleDbDataAdapter1.Fill(DataSet11.KENTEKENS)
If DataSet11.KENTEKENS.Count = 0 Then
erpKenteken.BlinkRate = 1000
erpKenteken.BlinkStyle = ErrorBlinkStyle.AlwaysBlink
erpKenteken.SetError(txtKenteken, "Kenteken bestaat niet")
e.Cancel = True
Else
erpKenteken.SetError(txtKenteken, "")
End If
DataSet11.AANHANGERS.Clear()
OleDbDataAdapter1.Fill(DataSet11.AANHANGERS)
End Sub

It works fine but is this the way ?
Any comments would be helpfull so i can go on.
Thanks
 
looks good to me

prima als het werkt

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
Thanks Chrissie,

But isn't it neccesary to put as much as possible in classes and modules !
 
only things that repeat themselves, and only then because you will have less work. Apparantley the compiler willput the code there where its needed and will copy the code as long as you dont have more then a 1000 lines of code.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
What does repeats itself ?
 
I mean in the above code.
 
nothing repeats itself in the above code thats why i think its just fine the way it is. but i dont know if you use the same code somewhere else or somewhere else in the same manner, same code other text to display. try to normalize as much as possible but dont overdo it.

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
Well Chrissie,

I want to thank you so much for your help, people like you make live "living in a wonderfull world".
I'm almost scared to ask you something else but i hope you will help out.
This is my problem : (Sorry have to do this in dutch)

Ik heb een form waar ik de nummerplaat ingeef van een vrachtwagen, als die nummerplaat bestaat dan worden de velden "nummerplaat van de aanhanger" en "Tarra" ingevuld.
Als bij de vrachtwagen geen "nummerplaat van de aanhanger" wordt gevonden dan opent zich een tweede form met datagrid waaruit ik een "nummerplaat van de aanhanger" kan kiezen met bijbehorende "Tarra".
De tweede form zou ik graag ook door andere forms laten gebruiken maar ik moet dan telkens de nummerplaat kunnen doorgeven. Is dit een voorbeeld voor een klassemodule, hoe geef ik telkens de nummerplaat door.
Sorry dat ik je weer iets vraag maar dit is erg belangrijk voor mij.
Alvast bedankt.
 
mail me here chris.baesnospam@skynet.be remove nospam

Christiaan Baes
Belgium

What a wonderfull world - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top