ChrisPadgham 113 Posting Whiz

No switch takes an integer you need if then else if construct

if ([textfield.text isequaltostring:@"someCase"]) {
    // do something
} else if ([textfield.text isequaltostring:@"anotherCase"]) {
    // do something else
} else {
    // do yet another thing
}
ChrisPadgham 113 Posting Whiz

That is not a label that is a text field. Drag a label across from the object library, it will have type of UILabel. If you are using the latest version of xcode you should be putting an underscore on the front when referrring to them locally,

[_label setText=@"Hello World"];

or

self.label.text = @"Hello World";
ChrisPadgham 113 Posting Whiz

if you double click on the control it should generate the appropriate handler for an click event.

ChrisPadgham 113 Posting Whiz

This is not normalised properly, Time, Date and Day should all be housed in the one field using a type of Date/Time. When you display them you can choose to display the one field three times for each of the values.

ChrisPadgham 113 Posting Whiz

If you just want a csv file you don't need excel.

open "c:\datafiles\homers_lineup_wk_1" for output as #1
write #1, var1, var2, var3
close #1
ChrisPadgham 113 Posting Whiz

barcode fonts are quite tall are you sure your UILabel is tall enough

ChrisPadgham 113 Posting Whiz

if [Tour Id] a number, if it is you should not have the single quotes in the the expression

strSQL = "Delete From Tour Where [Tour ID] = '" & fgdTour.TextMatrix(fgdTour.Row, 1) & "'"

ie

strSQL = "Delete From Tour Where [Tour ID] = " & fgdTour.TextMatrix(fgdTour.Row, 1) 
ChrisPadgham 113 Posting Whiz

try something like

Set fso = CreateObject("Scripting.FileSystemObject")
path = "C:\folder1"
fso.createFolder path
ChrisPadgham 113 Posting Whiz
ChrisPadgham 113 Posting Whiz

replace the or with and (&&)

ChrisPadgham 113 Posting Whiz

Nobody has answered because you have not asked a specific technical question. The forum does not supply solutions but if you have written something that does not work someone will help you debug it.

ChrisPadgham 113 Posting Whiz

check out the instr function eg

if instr(1, stringToSearch, "b") > 0 or instr(1, stringToSearch, "d")> 0 then
   msgbox "found"
end if
ChrisPadgham 113 Posting Whiz

if you are talking about ptr1 then it is destroyed when you exit fnCall2 and recreated the next time you enter the subroutine. You cannot rely on it retaining its value.

ChrisPadgham 113 Posting Whiz

From memory, I think you also need to set the keypreview property on the form otherwise the keypress will be sent to the control that has focus

ChrisPadgham 113 Posting Whiz

You are missing an

End If

after line 9

Jx_Man commented: +1 for eagle eyes :D +14
ChrisPadgham 113 Posting Whiz

oops, yes I missed that bit about the project name. I too prefer explicit joins laziness and too much time in the Oracle world must have overcome me. :-)

ChrisPadgham 113 Posting Whiz
SELECT Materials.Item_Name, Proj_Mat.qty FROM Materials, Proj_Mat WHERE 
Materials.Item_Code=Proj_Mat.Item_Code AND Proj_Mat.Proj_Id=CurrentProjId

CurrentProjId is obviously the project you wish to report on

ChrisPadgham 113 Posting Whiz

what technical documentation do you have on the gateway

ChrisPadgham 113 Posting Whiz

I think you should stay with a traditional relational design if you are planning to implement in a relational database. see below the table to hold bar visits.

barsVisited (visitId, PersonId, BarId, DateVisited)

the difficuly with your design is that it does not allow questions like
"how may people have visited bar X?" or "how many bars did I visit on 23/2/12?" to be answered easily

ChrisPadgham 113 Posting Whiz

datediff returns a number, ie number of days, number of hours, number seconds depending on the first parameter. so if you want the number of hours between the two the call looks like

noHours = datediff("h",[Work Start Time],[Work End Time])

or in SQL

noHours:datediff("h",[Work Start Time],[Work End Time])
ChrisPadgham 113 Posting Whiz

how does someone log in? are you displaying a login form and if so when? if it is in the form load event before you call CreateIdFolder ensure that it is displayed as modal otherwise the form load event will continue processing and not wait for the user to log in.

ChrisPadgham 113 Posting Whiz

use the datediff function, inspite of its name it handles times as well as dates.

ChrisPadgham 113 Posting Whiz

that is the simplest way

ChrisPadgham 113 Posting Whiz

please format your code

ChrisPadgham 113 Posting Whiz

you could set the visible property of the textbox to False or probably more simply just declare a local variable to hold the string

dim FileToOpen as String
FileToOpen = OpenFileDialog1.FileName
Aleksej commented: You also helped me. Thx +1
ChrisPadgham 113 Posting Whiz

The problem with WIA is a number of scanners don't fully support it (or don't support it at all) I used a product called EZTwain on one site where I had this problem which you might like to check out. You can download a trial version for free and the full version is only a few hundred dollars I think.

ChrisPadgham 113 Posting Whiz

you need to include the join on the user table, something like

AND a.userId=u.UserId
ChrisPadgham 113 Posting Whiz

you need to check whether the text box contains anything before you attempt to open it. After line 6 put an if statement

if textbox1.text <> "" then

and after line 9

end if
ChrisPadgham 113 Posting Whiz

Also TotalCost should be a module level variable declaration. By declaring it in each subroutine, it is created when the subroutine is invoked and destroyed when the subroutine terminates making it useless. Have one

dim TotalCost as Decimal

in the declarations section of the module at the top

ChrisPadgham 113 Posting Whiz
for i = 1 to 6
   OrderMenu(i).ItemName = ""
   OrderMenu(i).ItemCost = 0
next i
ChrisPadgham 113 Posting Whiz

Can I suggest you give it an alias

SELECT CONCAT( Table_Name, '.', Column_Name ) AS TableCol FROM

then use TableCol in your code.

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

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

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

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

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

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

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

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

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

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

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