ChrisPadgham 113 Posting Whiz

for a start you should be storing the student_no in the accounting_system table not the the student name.

ChrisPadgham 113 Posting Whiz
ChrisPadgham 113 Posting Whiz

hxf642 - Since you know you are going to place the 7 before 3 there is no need to ripple it down as you suggest. It will work but it is unnecessary processing. It is faster and less code just to move 3-6 up one spot and insert 7 where 3 was.

ChrisPadgham 113 Posting Whiz

you are best to use XML interface DOMDocument to iterate through the contents of this XML file and add to your list box.

ChrisPadgham 113 Posting Whiz

The code in VBA you will need to adjust it for .Net

ChrisPadgham 113 Posting Whiz

I am not sure how easy it will be to go from Word to Access, it is simpler to cut and paste the data into an Excel spreadsheet, make sure it is Ok then copy an paste from Excel into a blank table in MS Access.

You can deploy a MS-Access form to allow them to query it or write a simple VB program to query it.

ChrisPadgham 113 Posting Whiz

if date_received column typed as a Date/Time, then I am not sure whether that is a valid format. There should be a space instead of a . before Value which should be VALUES, also you need to construct the string, you cannot pass in the variables because they are out of scope for the database engine.
the last part of the string, from the first ")" should be something like

) VALUES(" & OrderNumber & ", " & CustomerId & ", #" & DBBDate & "#);"

ChrisPadgham 113 Posting Whiz

Well if we are going to be that thorough, I generally have a subroutine that both displays the msgbox and writes the error to a log file. I then have a list box 1 line deep that displays a chronological descending list of errors displayed to the user.

below is MSAccess code but you get the idea

Public Sub SetMessage(MessageText As String, MessageType As String, Optional SourceTable As String, Optional SourceRecId As Long)
Dim Work As String
Dim RecordId As Long

Set thisdb = CurrentDb()
If IsMissing(SourceRecId) Then RecordId = 0 Else RecordId = SourceRecId
MsgBox MessageText
Work = Convert(MessageText, "'", Chr$(34))
If IsMissing(SourceTable) Then
    CurrentDb().Execute "INSERT INTO MessageHistory (MessageType, Message, MessageDateTime) SELECT '" & MessageType & "' AS MessageType, '" & Work & "' As Message, Now() AS MessageDateTime;"
Else
    CurrentDb().Execute "INSERT INTO MessageHistory (MessageType, Message, MessageDateTime, SourceTableName, SourceRecordId) SELECT '" & MessageType & "' AS MessageType, '" & Work & "' As Message, Now() AS MessageDateTime, '" & SourceTable & "' AS SourceTableName, " & RecordId & " AS SourceRecordId;"
End If
Forms![MainScreen]![lstMessage].Requery
End Sub
ChrisPadgham 113 Posting Whiz

so is this data constant or changing. if it is constant, or relatively so, it is worth the effort to shift it to a database (probably MSAccess). Alternatively have you tested it in Excel. If you get your users to shift it to Excel it may solve your problem.

ChrisPadgham 113 Posting Whiz

In the form load, set focus to your text box. The data scanned from the scanner appears to your program as if the user has typed it in. It is usually terminated with CR so you can place data in the lost_focus event of the text box to

1. insert the scanned data into the database
2. clear the text box and set focus back to it ready for the next scan

note you will need at least one other object, possibly a button, on the form that is capable of receiving focus for this to work

ChrisPadgham 113 Posting Whiz

you don't need to disable the header. In your code before line two put some code like

if e.RowIndex < 0 then
  msgbox "Please double click on the cell you are interested in"
  exit sub
end if

it is better to provide instructive feedback to your user than simply disable things.

ChrisPadgham 113 Posting Whiz

try posting your data model we are guess at the SQL without knowing how your data is structured

ChrisPadgham 113 Posting Whiz

WIA is your best bet if your scanner drivers support it. Otherwise you will need to use TWAIN. There is a product called EZITWAIN which I have used at a client where WIA did not work.

Begginnerdev commented: Thanks for the input! +4
ChrisPadgham 113 Posting Whiz

It is hard to believe that you will be able to write something that will search faster than word can if you leave it in word format. If you load the data into a database first then searching on the database will be much faster.

ChrisPadgham 113 Posting Whiz

you can use an SQL INSERT statement eg

"INSERT INTO mytable (newname, newamount) VALUES('Fred',25);"

ChrisPadgham 113 Posting Whiz

if you want to write for Apple devices you will want to learn Objective-C

mani-hellboy commented: mmm i need more from you +2
ChrisPadgham 113 Posting Whiz

you never reset current, after the first pass of the inner loop and it is sitting at the end of the list and it is not reset for the subsequent pass

ChrisPadgham 113 Posting Whiz

The problem is you are just swapping the numbers. if you want to insert 7 in front of 3 you need to need to move the numbers in 3 - 6 up one in the array i.e.
6->7
5->6
4->5
3->4

and then put 7 in position 3.

note that you have to move the numbers in decending order for this work.

ChrisPadgham 113 Posting Whiz

so now is the time to plan your program and write some code. If you experience problems post the code snippet and someone will help you fix it.

ChrisPadgham 113 Posting Whiz

and what does this have to do with computer science, looks more like pure mathematics to me

ChrisPadgham 113 Posting Whiz

Sounds to me like you need a web service, time to check with the website owner whether one exists or if one can be created. Assuming there is one, the owner of the website should have documentation on how to utilise it.

ChrisPadgham 113 Posting Whiz

.sort is not support by all ADO, perhaps it is simpler to put the sort in the SQL

stSQL = "SELECT [Barcode ID] FROM Barcode ORDER BY [Barcode ID]"

ChrisPadgham 113 Posting Whiz

try this


Data1.Recordset.Sort "[Barcode ID] DESC"

ChrisPadgham 113 Posting Whiz

install the software and plug it in. Data coming from the barcode reader appears to your program as if the user had typed it in on the keyboard

ChrisPadgham 113 Posting Whiz

the square brackets should be around the fieldname

Data1.Recordset.Sort ("[Barcode ID] DESC")
Do Until Data1.Recordset.EOF    
   HE = Data1.Recordset("[Barcode ID]")    
   MsgBox HE    
   Data1.Recordset.MoveNext
Loop
ChrisPadgham 113 Posting Whiz

the filename of the database you wish to backup, eg


FSO.CopyFile App.Path & "\MyDatabase.mdb", sDBfn

you need to need to ensure that the database is not open at the time. The easiest is to start your VB program in sub Main and backup there before any links to the database have been created.

ChrisPadgham 113 Posting Whiz

for a start shouldn't it be DESC not DEC and

if you are talking to MS SQL Barcode ID cannot have a space in it, eg BarcodeId
if you are talking to MSAccess then it needs to be inclosed in square brackets [Barcode ID]

ChrisPadgham 113 Posting Whiz

we can't help with more details, can you publish your datamodel

AndreRet commented: Nice said +13
ChrisPadgham 113 Posting Whiz

As Waltp says, if you want to replace the whole contents of the text box or if you only want to replace a substring in the text box

text1.text = replace(text1.text,"original","new)

Replace function documented here

ChrisPadgham 113 Posting Whiz

i wouldn't bother doing it. Save the image in the file system and it's pathname in the database, you will save yourself a lot of problems later.

ChrisPadgham 113 Posting Whiz

isn't sDBTmpfn incorrect, it should be the file name of the database you are trying to back up.

and the MoveFile should probably be a CopyFile

ChrisPadgham 113 Posting Whiz

YOu still haven't explained what you are trying to achieve. I suspect you are overengineering this.

ChrisPadgham 113 Posting Whiz

should local host have a period after it

ChrisPadgham 113 Posting Whiz

the biggest problem you will have is establishing a unique primary key. They cannot be set from the server because if the server is down you will not be able to add new rows. Possibly the most practical solution is for each client machine to have a unique id. the primary key can then be a compound of the clientId & a record id. This would be allocated on the client database and a background process synching the server databse.

ChrisPadgham 113 Posting Whiz

This forum is really about helping with technical problems not doing your work for you. Micrsoft have some very good on line tutorials which you can do that will teach you these things.

ChrisPadgham 113 Posting Whiz

you can make one using vb.net, asp.net is for web forms

ChrisPadgham 113 Posting Whiz

so are the wrong records being selected or is it the correct records and the wrong data in the record

ChrisPadgham 113 Posting Whiz

you will need to provide more info. Can you provide the code.

ChrisPadgham 113 Posting Whiz

so what is the database and how are you trying to back it up

ChrisPadgham 113 Posting Whiz

Then just open the file as at text file and read it line by line processing as you go. There is a lot more coding involved by it is much much faster to execute.

ChrisPadgham 113 Posting Whiz

No you would read it from the PriceList table the same as you would the bracket id

ChrisPadgham 113 Posting Whiz

if you have more than one type you may be better with a user defined type

Public Type UserDetails
    MyName As String
    BackupName As String
    CurrId as Integer
End Type

dim Userlist(99) as UserDetails
ChrisPadgham 113 Posting Whiz

you can use DOMdocument to process XML in VB,

you use the method LoadXML(pathname) to load and there methods and properties to iterate through the XML file. A quick google search will show you how.

ChrisPadgham 113 Posting Whiz

Looks pretty reasonable, the Units are offered by Academics not by Academic Section so the relationship in Unit probably should be to Staff entity

there should be a relationship for LUC back to the Staff entity.

ChrisPadgham 113 Posting Whiz

Are you referring to a FileOpen dialog box

ChrisPadgham 113 Posting Whiz

Rather than calculating the Duration possibly

appointmentTime = starttime
do until appointmentTime >= endtime
    cmbTime.Items.Add(appointmentTime.ToString)
    appointmentTime = appointmentTime.AddMinutes(AppointmentDuration)
loop

note that if Appointment duration does not divide evenly the last appointment will overrun the end time. If this is not acceptable you will need to add the AppointmentDuration to the endTime in the until clause

ChrisPadgham 113 Posting Whiz

Can you explain more about your application and what you want to achieve (not how you want to do it) There may be another solution to your problem

ChrisPadgham 113 Posting Whiz

This forum is not really designed to do your homework for you. Do the design and if you have a particular problem with it someone will help you.

ChrisPadgham 113 Posting Whiz

one reason that it happens is that removing redundancy means that the redundant fields need to be recalculated each time they are required. take for example InvoiceTotal, the value is redundant because it is simply the sum of the InvoiceItem values. This means that instead of holding an Invoice Total in the database we sum the InvoiceItems each time we need to know the invoice total.

Thus we are doing many hits on the database instead of one.

ChrisPadgham 113 Posting Whiz

The problem is that you are trying to change standard windows behavior which is not good for the usability of your program, people will find it difficult to learn and use if it does not behave in an expected manner. Perhaps you can think about an alternative approach to achieving your objective.