ChrisPadgham 113 Posting Whiz

create an array of buttons that all respond to the same click event.

Assuming each button has a single letter on it, eg A, change line 20 to be

If Not Entry.Deleted And Command1.item(Index).caption = left$(Entry.FörNamn)   Then
ChrisPadgham 113 Posting Whiz

Can I suggest you look at MS Access in the first instance. It is a good starting point for learning about developing database applications. Whilst the programming is in VB not C# for a new comer it provides all you will need to develop your application.

ChrisPadgham 113 Posting Whiz

so what do you want to achieve, when they click a letter it returns the names from the file that start with that letter?

ChrisPadgham 113 Posting Whiz

surely you could have looked this up in microsofts reference material

http://msdn.microsoft.com

adam_k commented: I don't see a reason for negative vote here +9
ChrisPadgham 113 Posting Whiz

you would put a method in the view controller for the view that contains the button and that is linked to the touch up inside event. In this piece of code set the hidden property of the button to YES and the value of the button to the text box.

ChrisPadgham 113 Posting Whiz

The answer is still the same, once you have identified the offending entry

ListBox1.Items.RemoveAt(IndexOfSingleItem)
ChrisPadgham 113 Posting Whiz

Read up on linked tables, you can link the tables from one database in the other then use an SQL INSERT statement in your VBA to insert the data.

Currentdb.Execute "INSERT INTO table_new (F1, F2, F3) SELECT F1, F2, F3 FROM table_old
ChrisPadgham 113 Posting Whiz

try

SELECT Student.StudentNum, Student.FirstName, Student.LastName, Student.Initial, Event.Event, Event.EventDate, Transaction.Status
FROM (Student INNER JOIN Event ON Student.StudentNum = Event.StudentNum) INNER JOIN [Transaction] ON Student.StudentNum = Transaction.StudentNum;
ChrisPadgham 113 Posting Whiz

if you are saying that the item is to be available in multiple but not necessarily all areas then you need to create a new table call ItemArea, for example.

ItemArea (ItemAreaId, AreaId, ItemId)

then change the relationship to insert this table between Item and Area in you model.

ChrisPadgham 113 Posting Whiz

This appears to be generating HTML, where does Excel come into it.

ChrisPadgham 113 Posting Whiz

your zip file appears to be corrupt

ChrisPadgham 113 Posting Whiz

look on itunesU for iPhone programming by Paul Hegarty of Standford University. His on-line lectures are free and explain this well.

ChrisPadgham 113 Posting Whiz

you can remove line8 by formating your date in line 7

IDS = "APCSO" & format$(now,"ddmmmyyyy") & idhand
ChrisPadgham 113 Posting Whiz

is it because the class name and the instance name are the same.

how about

dim frmCustomers as New formCustomers
ChrisPadgham 113 Posting Whiz

you could try the cursorChanged event

ChrisPadgham 113 Posting Whiz

you need to concatenate the name to the string. The way you have it you are including the literal txtName.Text whereas you want the contents of txtName.text.

lblMessage.Text = "It looks like cloudy weather today, " & txtName.Text
ChrisPadgham 113 Posting Whiz

you are in part thinking of this incorrectly. You are providing two services to your clients; the obvious one, providing your manpower billed on a time basis. You are also providing your availability (or response time if you like), that is your customers have developed an expectation that if they contact you for support that you will respond in a certain time. This expectation is potentially costing you money because there may be other opportunities that arise that you will not be able to take because of these arrangements. So, let's say they give you no work and you have turned down other opportunities in case they needed you, you have lost both ways.

You need to consider a annual support agreement with your clients where they pay a certain amount to guarantee your availability. As part of this agreement they will get the first X hours of support for no additional cost (up to the value of the retainer) then at an agreed hourly rate after that.

This will allow you some ability to plan/predict your income for future periods.

ChrisPadgham 113 Posting Whiz

they thread is very old, please start your own, however there has been a number of recent posts on barcode scanners it may help to read these first.

ChrisPadgham 113 Posting Whiz

not to mention that you haven't set the connection string to anything.

ChrisPadgham 113 Posting Whiz

what is the problem, what is it producing and what did you expect
one thing you might like to look at is J is declared as an integer, IndexOf takes a int32 as a parameter, but it may not matter, VB may to the conversion for you

ChrisPadgham 113 Posting Whiz

why don't you try opening the csv file as a datasource rather than a file
similarly the xls and use SQL

INSERT INTO myXLdb (col1, col2, col2) SELECT col1, col2, col3 FROM myCSV

ChrisPadgham 113 Posting Whiz

Can I suggest you simply install XP rather than windows 7 on the PC.

ChrisPadgham 113 Posting Whiz

you can get that info from an API call, here is a link that will show you how

http://support.microsoft.com/kb/213267

ChrisPadgham 113 Posting Whiz

If a file is being held open by another process there is no way for you to delete it until that process terminates or releases the file.

ChrisPadgham 113 Posting Whiz

this looks like something you should be doing in your firewall. VB6 is an application development tool

ChrisPadgham 113 Posting Whiz

mod may be a reserved word try putting square brackets around it.

Set rc = db.OpenRecordset("select * from tablename where [mod] = '00B3C9'")
ChrisPadgham 113 Posting Whiz

The "database stuff" is one of the first steps, before you understand what data you are going to store and how it is organised you can't really design an application to maintain it.

First think of all the data elements you want to collect
student name, date of birth, amount paid, event name etc. Then try and establish the entities to which they belong. eg student name and date of birth belong to student. Event Name belongs to event.

Once you have them grouped into entities think about how the entities relate to one another eg Student attends event

Now build your self a database, (most easily in MSAccess) to hold this data. If you have done all this well, then designing the interface will be a piece of cake.

ChrisPadgham 113 Posting Whiz

you will have to parse the line yourself I think. check out the instr, and mid$ functions. The presence of a second set of brackets is going to make it tricky. have a think about the logic and post what you come up with.

ChrisPadgham 113 Posting Whiz

hex is only a way of representing a number for human consumption, they are held in binary after all.

What is the data type that is holding the number, is it a text string or an integer. That will determine what your findfirst looks like. Text fields have quotes around them, integers do not.

ChrisPadgham 113 Posting Whiz

not that I am not a great fan of VB6 but don't you think it would be more appropriate to tackle your assignment in a more modern language, say vb.net
alternatively, it is a piece of cake in MS Access

ChrisPadgham 113 Posting Whiz

The barcode scanner will have come with some drivers, install these and it should work as described above.

ChrisPadgham 113 Posting Whiz

rows 23 - 37 can be replaced with a single SQL statement

cmd.CommandText = "UPDATE booking_details INNER JOIN Table_Details ON booking_details.TableId = Table_Details.TableId SET Table_Details.Reserved = "No" WHERE (((booking_details.ReservationId)=" & Id1 & "));"

not only less code but it will execute much much faster than manually looping through.

ChrisPadgham 113 Posting Whiz

check out the eval function from the microsoft script control

http://www.devx.com/vb2themax/Tip/18773

ChrisPadgham 113 Posting Whiz

you don't need a two dimensional array. Read a name from the file, then loop through the names that you have loaded until you find one that is less than this one. insert the name in the list before this entry.

when you are complete read the list from the start printing it as you go.

ChrisPadgham 113 Posting Whiz

Are you sure this is the correct approach, the barcode scanners I have used present the data as if it had been typed on the keyboard. ie. you set focus to a text box, scan the barcode and the barcode appears in the text box followed by a CR.

If you want to process the barcode you put some code in the LostFocus event of the text box.

ChrisPadgham 113 Posting Whiz

I don't really think that shelling out to a batch file is particularly good. It might be better to write to the printer directly yourself. you can open it as follows

open PRN for output as #2

As far as previewing, why don't you load the lines from the file into a list box then your user could scroll up and down through the report.

ChrisPadgham 113 Posting Whiz

So is ByVal the default?

ChrisPadgham 113 Posting Whiz

add a button to your form and copy the code you have above to the click event.

ChrisPadgham 113 Posting Whiz

Look for documentation on the UPDATE keyword, you use SET with that.

ChrisPadgham 113 Posting Whiz

please post what your database looks like, ie what tables does it have and what fields are there in each table.

ChrisPadgham 113 Posting Whiz

or possibly

combobox.refreshitems
ChrisPadgham 113 Posting Whiz
ChrisPadgham 113 Posting Whiz

first you will need to change your database table to store the privilege.
second change the SELECT statement to something like

sql = "SELECT Privilege FROM Usertbl WHERE ......

you can use the rec.recordcount to determine whether any records were returned.

rec!privelege to retrieve their privileges

ChrisPadgham 113 Posting Whiz

why are you storing the priveleges in a separate table, you could have another field in the Usertbl to hold them.

Then change your select to read the priveleges, rather than the count that is there are the moment.

ChrisPadgham 113 Posting Whiz

well in the first instance, probably the number should be generated by the database.
secondly, this field should have an index indicating no duplicates, eg the primary key, then there is not this situation can occur

ChrisPadgham 113 Posting Whiz

the way calculators normally work is that
You type the first number
You hit +
You type the second number
You hit = (or plus again)

So you need some variables to remember
1. the first number that was typed,
2. the operator that was clicked

Your numbers should be buttons not labels with code like

private sub cmd1_click()
  lblTotal.text = lblTotal.text & "1"
end sub

when the user click on the plus you have to remember this value and the function

private sub cmdPlus_Click
   FirstNumber = lblTotal.text  ' FirstNumber will need to be a module based variable
   Operator = "+"
   lblTotal.Text = ""
end if

the code for = will need to be something like

private sub cmdEqual_Click()
   select Case Operator
       case "+"
          lblTotal.text = lblTotal.text + FirstNumber
       case "-"
          lblTotal.text = FirstNumber - lblTotal.text
   end select
end if
ChrisPadgham 113 Posting Whiz

If you are writing them out again as text strings why not just declare them as string on lines 10 & 11.

If you want to validate then try using the IsNumeric function, ie

if not isnumeric(dblYearlyIncome.text.tostring) then 
    msgbox "some error"
    exit sub
end if
ChrisPadgham 113 Posting Whiz

Either that or, after you have loaded the table, open its tabledef and check the field name of each field, changing if necessary.

ChrisPadgham 113 Posting Whiz

sounds interesting, let us know what you come up with.

AndreRet commented: Well said, lol +13
ChrisPadgham 113 Posting Whiz

shouldn't line 4 be AS not S